home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / educ / econ.bas < prev    next >
BASIC Source File  |  1990-09-29  |  7KB  |  151 lines

  1. 0 CLEAR 1000:WIDTH 80
  2. 10 REM THIS PROGRAM IS WRITTEN IN MBASIC AND IS CALLED ECON.BAS
  3. 20 CLS
  4. 30 PRINT "          ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄";
  5. 40 PRINT:PRINT
  6. 50 PRINT "                 ECONOMETRICS UTILITIES";
  7. 60 PRINT:PRINT
  8. 70 PRINT "                            by                                     ";
  9. 80 PRINT "                 Stephen L. White, Ph.D.                             ";
  10. 90 PRINT "                               " ;
  11. 100 PRINT:PRINT
  12. 110 PRINT "          ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" ;
  13. 120 PRINT:PRINT:PRINT
  14. 130 PRINT "                     MENU OF PROGRAMS                              ";
  15. 140 PRINT:PRINT
  16. 150 PRINT "     1. ADJUSTED R²                                                "
  17. 160 PRINT "     2. F TEST (for usefulness of dropped regression variables)    ";
  18. 170 PRINT "     3. CHOW TEST (for equality of coefficients)                   ";
  19. 175 PRINT "     4. DURBIN h STATISTIC (for autocorrelation in lagged variables)";
  20. 180 PRINT "     5. Return to System                                           ";
  21. 190 PRINT:PRINT:PRINT
  22. 200 PRINT "What program would you like to run";:INPUT X
  23. 210 IF (X = 1) THEN GOTO 230 ELSE IF (X = 2) THEN GOTO 490 ELSE IF (X = 3) THEN GOTO 780 ELSE IF (X=4) THEN GOTO 1200
  24. 219 PRINT:PRINT
  25. 220 IF (X = 5) THEN SYSTEM
  26. 230 CLS
  27. 240 PRINT "          ┌──────────────────────────────────────┐" ;
  28. 250 PRINT "          │                                      │" ;
  29. 260 PRINT "          │   ADJUSTED (or corrected) R SQUARE   │" ;
  30. 270 PRINT "          │                                      │" ;
  31. 280 PRINT "          └──────────────────────────────────────┘" ;
  32. 290 PRINT:PRINT:PRINT
  33. 300 PRINT  "IF THERE IS ONLY ONE INDEPENDENT VARIABLE IN YOUR MODEL, R² = ADJUSTED R²." ;
  34. 310 PRINT:PRINT:PRINT
  35. 320 PRINT:PRINT
  36. 330 PRINT "What was the R² from the regression results" ;:INPUT A
  37. 340 PRINT:PRINT
  38. 350 PRINT "How many independent variables are in the model";:INPUT B
  39. 360 PRINT:PRINT
  40. 370 PRINT "How many observations are in the model" ;:INPUT C
  41. 380 PRINT:PRINT:PRINT:PRINT
  42. 390 LET R=1-(1-A)*((C-1)/(C-B))
  43. 400 PRINT "               Adjusted R² =" ;R
  44. 410 PRINT:PRINT:PRINT
  45. 420 Z =R*100
  46. 430 PRINT Z" percent of the variation in Y is explained by the model."
  47. 440 PRINT:PRINT:PRINT
  48. 450 PRINT "Do you want to adjust another R²? (Type 1 for YES or 2 for NO)";:INPUT X
  49. 460 PRINT:PRINT
  50. 470 IF X <2 THEN GOTO 230 ELSE GOTO 20
  51. 480 END
  52. 490 CLS
  53. 500  PRINT "────────────────────────────────────────────────────────────" ;
  54. 510 PRINT
  55. 520  PRINT "                         F Test" ;
  56. 530 PRINT
  57. 540 PRINT "FOR DETERMINING USEFULNESS OF DROPPED REGRESSION VARIABLE(S)" ;
  58. 550 PRINT
  59. 560 PRINT "────────────────────────────────────────────────────────────" ;
  60. 570 PRINT:PRINT:PRINT:PRINT
  61. 580  PRINT "What is the Error Sum of Squares for the original regression";:INPUT B
  62. 590 PRINT:PRINT
  63. 600 PRINT "What is the Error Sum of Squares for the restricted regression";:INPUT A
  64. 610 PRINT:PRINT
  65. 620  PRINT "How many variables from the original regression are dropped";:INPUT C
  66. 630 PRINT:PRINT
  67. 640 PRINT "How many observations are there";:INPUT D
  68. 650 PRINT:PRINT
  69. 660 PRINT "How many regressors were in your original model";: INPUT K
  70. 670 PRINT:PRINT
  71. 675 LET F=((A-B)/C)/(B/(D-K-1))
  72. 680 PRINT "           F Statistic = " ;F
  73. 690 PRINT:PRINT
  74. 700 PRINT "Ho = Dropped variable(s) do not contribute to strength of model"
  75. 710 PRINT "           IF OBSERVED F IS < TABLE VALUE, ACCEPT Ho"
  76. 720 PRINT "           IF OBSERVED F IS > TABLE VALUE, REJECT Ho"
  77. 730 PRINT:PRINT:PRINT
  78. 740 PRINT "Do you want to do another F TEST? (Type 1 for YES or 2 for NO)" ;: INPUT X
  79. 750 PRINT:PRINT:PRINT:PRINT
  80. 760 IF X <2 THEN GOTO 580 ELSE GOTO 20
  81. 770 END
  82. 780 CLS
  83. 790 PRINT "          ┌──────────────────────────────┐" ;
  84. 800 PRINT
  85. 810 PRINT "          │           CHOW  TEST         │" ;
  86. 820 PRINT
  87. 830 PRINT "          │ For Equality of Coefficients │" ;
  88. 840 PRINT
  89. 850 PRINT "          │    (for up to six groups)    │" ;
  90. 860 PRINT
  91. 870 PRINT "          └──────────────────────────────┘" ;
  92. 880 PRINT:PRINT:PRINT
  93. 890 PRINT "How many regressors are in the combined model";:INPUT K
  94. 900 PRINT:PRINT:PRINT
  95. 910 PRINT "How many cases or observations are there";:INPUT N
  96. 920 PRINT:PRINT:PRINT
  97. 930 PRINT "What is the Error Sum of Squares for the combined model";:INPUT A
  98. 940 PRINT:PRINT:PRINT
  99. 950 PRINT "How many variables from the original model have been dropped";
  100. 960 PRINT "in the new separate regressions";: INPUT R
  101. 970 PRINT:PRINT:PRINT
  102. 980 PRINT "What are the Error Sums of Squares for each separate regression";
  103. 990 PRINT:PRINT:
  104. 1000 PRINT  "       1ST ESS" ;: INPUT B
  105. 1010 PRINT  "       2nd ESS" ;: INPUT C
  106. 1020 PRINT  "       3rd ESS" ;: INPUT D
  107. 1030 PRINT  "       4th ESS" ;: INPUT E
  108. 1040 PRINT  "       5th ESS" ;: INPUT F
  109. 1050 PRINT  "       6th ESS" ;: INPUT G
  110. 1060 X=((A-(B+C+D+E+F+G))/R)/((B+C+D+E+F+G)/((N-K)-1))
  111. 1070 PRINT:PRINT:PRINT
  112. 1080 PRINT "          F = ";X
  113. 1090 PRINT:PRINT:PRINT
  114. 1100 PRINT "Ho = Every coefficient has the same value in each separate regression.";
  115. 1110 PRINT  "       If F = or < table value, accept Ho.";
  116. 1120 PRINT: PRINT  "       If F = or > table value, reject Ho.";
  117. 1130 PRINT:PRINT:PRINT
  118. 1140 PRINT "Do you want to test another set of regressions (1=YES or 2=NO)";:INPUT L
  119. 1150 IF L = 1 THEN GOTO 780 ELSE GOTO 20
  120. 1160 END
  121. 1200 CLS
  122. 1210 PRINT "       ┌────────────────────────────────┐" ;
  123. 1220 PRINT "       │                                │" ;
  124. 1230 PRINT "       │       DURBIN h STATISTIC       │" ;
  125. 1240 PRINT "       │                                │" ;
  126. 1250 PRINT "       └────────────────────────────────┘" ;
  127. 1260 PRINT:PRINT:PRINT
  128. 1270 PRINT "How many observations are in the model";: INPUT C
  129. 1280 PRINT:PRINT
  130. 1290 PRINT "What is the Standard Error of the Coefficient of the" ;
  131. 1295 PRINT " lagged variable" ;: INPUT B
  132. 1296 LET M=C*(B^2)
  133. 1297 IF (M=>1) THEN GOTO 1421 ELSE 1300
  134. 1300 PRINT:PRINT
  135. 1310 PRINT "What is the value of the Durbin-Watson Statistic" ;: INPUT A
  136. 1330 LET H=(1-(A/2))*(SQR(C/(1-(C*(B^2)))))
  137. 1335 PRINT:PRINT
  138. 1370 PRINT "          DURBIN h STATISTIC =  " ; H
  139. 1380 PRINT:PRINT
  140. 1390 PRINT "Use a table for the normal distribution to test" ;
  141. 1395 PRINT " Ho = no autocorrelation." ;
  142. 1400 PRINT:PRINT
  143. 1410 PRINT "Do you want to run this test again? (type 1 for YES or 2 for NO)";:INPUT P
  144. 1420 IF P<2 THEN GOTO 1200 ELSE GOTO 20
  145. 1421 CLS:BEEP:BEEP:BEEP
  146. 1422 PRINT"ERROR: This test will not work if the number of observations"
  147. 1423 PRINT"multiplied by the square of the Standard Error of the Coefficient"
  148. 1424 PRINT"is equal to or greater than one."
  149. 1425 PRINT:PRINT:PRINT:GOTO 1400
  150. 1430 END
  151.