forked from burakbayramli/books
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpt6.txt
More file actions
1430 lines (1351 loc) · 74.4 KB
/
Copy pathExpt6.txt
File metadata and controls
1430 lines (1351 loc) · 74.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Chapter 17. Regressions with Lagged Variables
/*=================================================================
Example 17.1. A Model of the Demand for Gasoline
No Computations
*/=================================================================
/*=================================================================
Example 17.2. Polynomial Distributed Lag Model for Gasoline Demand
*/=================================================================
Read ; Nobs = 36 ; Nvar = 11 ; Names =
Year, G, Pg, Y, Pnc, Puc, Ppt, Pd, Pn, Ps, Pop $
1960 129.7 .925 6036 1.045 .836 .810 .444 .331 .302 180.7
1961 131.3 .914 6113 1.045 .869 .846 .448 .335 .307 183.7
1962 137.1 .919 6271 1.041 .948 .874 .457 .338 .314 186.5
1963 141.6 .918 6378 1.035 .960 .885 .463 .343 .320 189.2
1964 148.8 .914 6727 1.032 1.001 .901 .470 .347 .325 191.9
1965 155.9 .949 7027 1.009 .994 .919 .471 .353 .332 194.3
1966 164.9 .970 7280 .991 .970 .952 .475 .366 .342 196.6
1967 171.0 1.000 7513 1.000 1.000 1.000 .483 .375 .353 198.7
1968 183.4 1.014 7728 1.028 1.028 1.046 .501 .390 .368 200.7
1969 195.8 1.047 7891 1.044 1.031 1.127 .514 .409 .386 202.7
1970 207.4 1.056 8134 1.076 1.043 1.285 .527 .427 .407 205.1
1971 218.3 1.063 8322 1.120 1.102 1.377 .547 .442 .431 207.7
1972 226.8 1.076 8562 1.110 1.105 1.434 .555 .458 .451 209.9
1973 237.9 1.181 9042 1.111 1.176 1.448 .566 .497 .474 211.9
1974 225.8 1.599 8867 1.175 1.226 1.480 .604 .572 .513 213.9
1975 232.4 1.708 8944 1.276 1.464 1.586 .659 .615 .556 216.0
1976 241.7 1.779 9175 1.357 1.679 1.742 .695 .638 .598 218.0
1977 249.2 1.882 9381 1.429 1.828 1.824 .727 .671 .648 220.2
1978 261.3 1.963 9735 1.538 1.865 1.878 .769 .719 .698 222.6
1979 248.9 2.656 9829 1.660 2.010 2.003 .821 .800 .756 225.1
1980 226.8 3.691 9722 1.793 2.081 2.516 .892 .894 .839 227.7
1981 225.6 4.109 9769 1.902 2.569 3.120 .957 .969 .926 230.0
1982 228.8 3.894 9725 1.976 2.964 3.460 1.000 1.000 1.000 232.2
1983 239.6 3.764 9930 2.026 3.297 3.626 1.041 1.021 1.062 234.3
1984 244.7 3.707 10421 2.085 3.757 3.852 1.038 1.050 1.117 236.3
1985 245.8 3.738 10563 2.152 3.797 4.028 1.045 1.075 1.173 238.5
1986 269.4 2.921 10780 2.240 3.632 4.264 1.053 1.069 1.224 240.7
1987 276.8 3.038 10859 2.321 3.776 4.413 1.085 1.111 1.271 242.8
1988 279.9 3.065 11186 2.368 3.939 4.494 1.105 1.152 1.336 245.0
1989 284.1 3.353 11300 2.414 4.019 4.719 1.129 1.213 1.408 247.3
1990 282.0 3.834 11389 2.451 3.926 5.197 1.144 1.285 1.482 249.9
1991 271.8 3.766 11272 2.538 3.942 5.427 1.167 1.332 1.557 252.6
1992 280.2 3.751 11466 2.528 4.113 5.518 1.184 1.358 1.625 255.4
1993 286.7 3.713 11476 2.663 4.470 6.086 1.200 1.379 1.684 258.1
1994 290.2 3.732 11636 2.754 4.730 6.268 1.225 1.396 1.734 260.7
1995 297.8 3.789 11934 2.815 5.224 6.410 1.239 1.419 1.786 263.2
Create ; lg = Log(100*G/Pop)
; ly = Log(Y)
; lpg= Log(Pg)
; lpnc = Log(Pnc)
; lpuc = log(Puc)
; lppt = log(Ppt)
; t=trn(1,1) $
Create ; lg1=lg[-1]
; ly1=ly[-1] ; ly2=ly[-2] ; ly3=ly[-3] ; ly4=ly[-4] ; ly5=ly[-5]
; lp1=lpg[-1] ; lp2=lpg[-2] ; lp3=lpg[-3] ; lp4=lpg[-4] ; lp5=lpg[-5] $
?
? Models are fit to 31 observations, using 5 lagged values
?
Sample ; 6 - 36 $
?
? Unrestricted Least Squares
?
Regress ; Lhs = lg ; Rhs = one,lpnc,lpuc,lppt,t,
lpg,lp1,lp2,lp3,lp4,lp5,ly$
Calc ; List ; eeols = sumsqdev
; dfols = degfrdm $
?
? 2nd order polynomial, without then with AR1 correction
?
Sample ; 1 - 36 $
Create ; lpg=pdl(5,2) $
Sample ; 6 - 36 $
Regress ; Lhs= lg ; Rhs = one,lpnc,lpuc,lppt,t,lpgpdl,ly$
Calc ; List ; eepdl2=sumsqdev
; dfpdl2=degfrdm$
Regress ; Lhs= lg ; Rhs = one,lpnc,lpuc,lppt,t,lpgpdl,ly;AR1$
?
? 3rd order polynomial
?
Sample ; 1 - 36 $
Create ; lpg=pdl(5,3) $
Sample ; 6 - 36 $
Regress ; Lhs= lg ; Rhs = one,lpnc,lpuc,lppt,t,lpgpdl,ly$
Calc ; List ; eepdl3=sumsqdev
; dfpdl3=degfrdm$
?
? F tests, second vs. third order polynomial, then 3rd order
? as a restriction on 2nd order.
?
Calc ; List ; F23 = ((eepdl2-eepdl3)/1)/(eepdl3/dfpdl3)
; Ftb(.95,1,dfpdl3) $
Calc ; List ; Fpdl = ((eepdl3-eeols)/2)/(eeols/dfols)
; Ftb(.95,2,dfols) $
/*
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = LG Mean= 4.649873861 , S.D.= .9622470146E-01 |
| Model size: Observations = 31, Parameters = 12, Deg.Fr.= 19 |
| Residuals: Sum of squares= .8303207771E-02, Std.Dev.= .02090 |
| Fit: R-squared= .970108, Adjusted R-squared = .95280 |
| Model test: F[ 11, 19] = 56.06, Prob value = .00000 |
| Diagnostic: Log-L = 83.5020, Restricted(b=0) Log-L = 29.0943 |
| LogAmemiyaPrCrt.= -7.408, Akaike Info. Crt.= -4.613 |
| Autocorrel: Durbin-Watson Statistic = 1.74444, Rho = .12778 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -17.08775284 1.5611540 -10.946 .0000
LPNC .2198037154 .17335206 1.268 .2201 .50841999
LPUC -.9241180560E-03 .99053319E-01 -.009 .9927 .78396138
LPPT .2640625178E-01 .93288799E-01 .283 .7802 .92045241
T -.2770071860E-01 .90740536E-02 -3.053 .0065 21.000000
LPG -.1737208060 .48044800E-01 -3.616 .0018 .79662045
LP1 -.3687630289E-01 .76569919E-01 -.482 .6356 .75074862
LP2 .8680206340E-01 .74127029E-01 1.171 .2561 .70550661
LP3 -.3733949993E-02 .70820378E-01 -.053 .9585 .66046438
LP4 -.8936895355E-01 .69289926E-01 -1.290 .2126 .61491769
LP5 -.6328003655E-01 .50299863E-01 -1.258 .2236 .56962818
LY 2.440977433 .18013091 13.551 .0000 9.1694046
EEOLS = .83032077708087690D-02
DFOLS = .19000000000000000D+02
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = LG Mean= 4.649873861 , S.D.= .9622470146E-01 |
| Model size: Observations = 31, Parameters = 9, Deg.Fr.= 22 |
| Residuals: Sum of squares= .9631976462E-02, Std.Dev.= .02092 |
| Fit: R-squared= .965325, Adjusted R-squared = .95272 |
| Model test: F[ 8, 22] = 76.56, Prob value = .00000 |
| Diagnostic: Log-L = 81.2010, Restricted(b=0) Log-L = 29.0943 |
| LogAmemiyaPrCrt.= -7.479, Akaike Info. Crt.= -4.658 |
| Autocorrel: Durbin-Watson Statistic = 1.74520, Rho = .12740 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -16.91150020 1.5575025 -10.858 .0000
LPNC .2262608275 .17344777 1.304 .2055 .50841999
LPUC .3549823408E-01 .95933337E-01 .370 .7149 .78396138
LPPT .9240455060E-01 .80601607E-01 1.146 .2639 .92045241
T -.3138697432E-01 .86656653E-02 -3.622 .0015 21.000000
LPG000 -.1543160936 .29511864E-01 -5.229 .0000 4.0978859
LPG001 .1323144319 .30976075E-01 4.272 .0003 9.4509666
LPG002 -.2535430454E-01 .60348694E-02 -4.201 .0004 33.596342
LY 2.423959361 .17986157 13.477 .0000 9.1694046
EEPDL2 = .96319764618999180D-02
DFPDL2 = .22000000000000000D+02
Polynomial Distributed Lag for LPG
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1543 .2951E-01 -5.23 .0000|****************| |
1 -.4736E-01 .1680E-01 -2.82 .0100| ****| |
2 .8896E-02 .2133E-01 .42 .6807| |* |
3 .1444E-01 .2173E-01 .66 .5133| |* |
4 -.3073E-01 .1705E-01 -1.80 .0853| **| |
5 -.1266 .2724E-01 -4.65 .0001| ******| |
+----------------+----------------+
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1543 .2951E-01 -5.23 .0000| *******| |
1 -.2017 .4101E-01 -4.92 .0001| **********| |
2 -.1928 .5076E-01 -3.80 .0010| *********| |
3 -.1783 .6538E-01 -2.73 .0123| *********| |
4 -.2091 .8041E-01 -2.60 .0163| **********| |
5 -.3357 .9556E-01 -3.51 .0020|****************| |
+----------------+----------------+
+---------------------------------------------+
| AR(1) Model: e(t) = rho * e(t-1) + u(t) |
| Initial value of rho = .12740 |
| Iter= 12, SS= .009, Log-L= 81.665496 |
| Final value of Rho = .29580 |
| Durbin-Watson: e(t) = 1.40133 |
| Std. Deviation: e(t) = .02155 |
| Std. Deviation: u(t) = .02058 |
| Durbin-Watson: u(t) = 1.82015 |
| Autocorrelation: u(t) = .08992 |
| N[0,1] used for significance levels |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -15.35236510 1.8055644 -8.503 .0000
LPNC .2244016538 .19555679 1.148 .2512 .50841999
LPUC -.1668084047E-01 .10109839 -.165 .8689 .78396138
LPPT .6004852097E-01 .90518314E-01 .663 .5071 .92045241
T -.2559959111E-01 .93482833E-02 -2.738 .0062 21.000000
LPG000 -.1439744257 .31293522E-01 -4.601 .0000 4.0978859
LPG001 .1299018707 .32730356E-01 3.969 .0001 9.4509666
LPG002 -.2493123446E-01 .63769665E-02 -3.910 .0001 33.596342
LY 2.244778785 .20791786 10.796 .0000 9.1694046
RHO .2958001545 .17440396 1.696 .0899
Polynomial Distributed Lag for LPG
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1440 .3129E-01 -4.60 .0000|****************| |
1 -.3900E-01 .1835E-01 -2.13 .0336| ***| |
2 .1610E-01 .2302E-01 .70 .4843| |* |
3 .2135E-01 .2331E-01 .92 .3596| |** |
4 -.2327E-01 .1833E-01 -1.27 .2043| **| |
5 -.1177 .2907E-01 -4.05 .0001| *******| |
+----------------+----------------+
Polynomial Distributed Lag for LPG
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1440 .3129E-01 -4.60 .0000| ********| |
1 -.1830 .4397E-01 -4.16 .0000| **********| |
2 -.1669 .5490E-01 -3.04 .0024| *********| |
3 -.1455 .7043E-01 -2.07 .0388| ********| |
4 -.1688 .8571E-01 -1.97 .0489| *********| |
5 -.2865 .1003 -2.86 .0043|****************| |
+----------------+----------------+
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = LG Mean= 4.649873861 , S.D.= .9622470146E-01 |
| Model size: Observations = 31, Parameters = 10, Deg.Fr.= 21 |
| Residuals: Sum of squares= .8558872683E-02, Std.Dev.= .02019 |
| Fit: R-squared= .969188, Adjusted R-squared = .95598 |
| Model test: F[ 9, 21] = 73.39, Prob value = .00000 |
| Diagnostic: Log-L = 83.0319, Restricted(b=0) Log-L = 29.0943 |
| LogAmemiyaPrCrt.= -7.526, Akaike Info. Crt.= -4.712 |
| Autocorrel: Durbin-Watson Statistic = 1.83377, Rho = .08311 |
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -17.08364725 1.5064705 -11.340 .0000
LPNC .2204503494 .16738649 1.317 .2020 .50841999
LPUC -.2838362129E-02 .95527401E-01 -.030 .9766 .78396138
LPPT .1998453763E-01 .89664082E-01 .223 .8258 .92045241
T -.2723837429E-01 .87430957E-02 -3.115 .0052 21.000000
LPG000 -.1948932683 .37896102E-01 -5.143 .0000 4.0978859
LPG001 .3148722857 .11640863 2.705 .0133 9.4509666
LPG002 -.1215476937 .59567283E-01 -2.041 .0541 33.596342
LPG003 .1267840792E-01 .78134438E-02 1.623 .1196 134.78559
LY 2.440155167 .17382323 14.038 .0000 9.1694046
EEPDL3 = .85588726828253890D-02
DFPDL3 = .21000000000000000D+02
Polynomial Distributed Lag for LPG
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1949 .3790E-01 -5.14 .0000|****************| |
1 .1111E-01 .3951E-01 .28 .7813| |* |
2 .5009E-01 .3268E-01 1.53 .1403| |**** |
3 -.1889E-02 .2325E-01 -.08 .9360| *| |
4 -.6875E-01 .2863E-01 -2.40 .0257| *****| |
5 -.7442E-01 .4153E-01 -1.79 .0876| ****| |
+----------------+----------------+
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 -.1949 .3790E-01 -5.14 .0000| ***********| |
1 -.1838 .4107E-01 -4.47 .0002| ***********| |
2 -.1337 .6103E-01 -2.19 .0399| ********| |
3 -.1356 .6836E-01 -1.98 .0605| ********| |
4 -.2043 .7764E-01 -2.63 .0156| ************| |
5 -.2788 .9864E-01 -2.83 .0101|****************| |
+----------------+----------------+
F23 = .26329611615540450D+01
Result = .43247937183399980D+01
FPDL = .29251546284277880D+00
Result = .35218932605800020D+01
/*=================================================================
Example 17.2A. Polynomial Distributed Lag Models. From earlier
editions of the text. This is Almon’s analysis.
*/=================================================================
Read ; Nobs = 60 ; Nvar = 3 ; Names = 1 $
QTR Y X
1953.1 2072.0 1660.0
1953.2 2077.0 1926.0
1953.3 2078.0 2181.0
1953.4 2043.0 1897.0
1954.1 2062.0 1695.0
1954.2 2067.0 1705.0
1954.3 1964.0 1731.0
1954.4 1981.0 2151.0
1955.1 1914.0 2556.0
1955.2 1991.0 3152.0
1955.3 2129.0 3763.0
1955.4 2309.0 3903.0
1956.1 2614.0 3912.0
1956.2 2896.0 3571.0
1956.3 3058.0 3199.0
1956.4 3309.0 3262.0
1957.1 3446.0 3476.0
1957.2 3466.0 2993.0
1957.3 3435.0 2262.0
1957.4 3183.0 2011.0
1958.1 2697.0 1511.0
1958.2 2338.0 1631.0
1958.3 2140.0 1990.0
1958.4 2012.0 1993.0
1959.1 2071.0 2520.0
1959.2 2192.0 2804.0
1959.3 2240.0 2919.0
1959.4 2421.0 3024.0
1960.1 2639.0 2725.0
1960.2 2733.0 2321.0
1960.3 2721.0 2131.0
1960.4 2640.0 2552.0
1961.1 2513.0 2234.0
1961.2 2448.0 2282.0
1961.3 2429.0 2533.0
1961.4 2516.0 2517.0
1962.1 2534.0 2772.0
1962.2 2494.0 2380.0
1962.3 2596.0 2568.0
1962.4 2572.0 2944.0
1963.1 2601.0 2629.0
1963.2 2648.0 3133.0
1963.3 2840.0 3449.0
1963.4 2937.0 3764.0
1964.1 3136.0 3983.0
1964.2 3299.0 4381.0
1964.3 3514.0 4786.0
1964.4 3815.0 4094.0
1965.1 4093.0 4870.0
1965.2 4262.0 5344.0
1965.3 4531.0 5433.0
1965.4 4825.0 5911.0
1966.1 5160.0 6109.0
1966.2 5319.0 6542.0
1966.3 5574.0 5785.0
1966.4 5749.0 5707.0
1967.1 5715.0 5412.0
1967.2 5637.0 5465.0
1967.3 5383.0 5550.0
1967.4 5467.0 5465.0
?
? Data Setup. Create lagged variables
?
Create ; q1=dmy(4,1) ; q2=dmy(4,2)
; q3=dmy(4,3) ; q4=dmy(4,4) $
Create ; x1=x[-1] ; x2=x[-2] ; x3=x[-3] ; x4=x[-4]
; x5=x[-5] ; x6=x[-6] ; x7=x[-7] ; x0=x $
?
? Data set includes some extra observations. Results use only Almon’s
? Original data set, 1953 to 1961.
?
Sample ; 8-36 $
?-----------------------------------------------------------------------
? Unrestricted, by OLS, quarterly dummies sum to 0.
? Wald command displays 4th quarter dummy coefficient
?-----------------------------------------------------------------------
Regress; Lhs = Y ; Rhs = q1,q2,q3,q4,x0,x1,x2,x3,x4,x5,x6,x7
; cls: b(1)+b(2)+b(3)+b(4) = 0 ; Res = u $
Calc ; List ; EE0=Sumsqdev ; DF0=Degfrdm $
Create ; du = u-u[-1] $
Create ; If(_Obsno = 1)du=0 $
Calc ; List ; DW = du'du/u'u $
Wald ; Fn1 = b0+b1+b2+b3+b4+b5+b6+b7
; Start = b ; var=Varb ; Labels=c1,c2,c3,c4,b0,b1,b2,b3,b4,b5,b6,b7 $
?-----------------------------------------------------------------------
? Unrestricted, by MLE for AR(1) model, quarterly dummies sum to 0.
?-----------------------------------------------------------------------
Create ; dq1=q1-q4;dq2=q2-q4;dq3=q3-q4 $
Regress; Lhs = Y
; Rhs = dq1,dq2,dq3,x0,x1,x2,x3,x4,x5,x6,x7
; AR1 ; Alg=MLE $
Wald ; Fn1 = b0+b1+b2+b3+b4+b5+b6+b7
; Fn2 = -c1-c2-c3
; Start = b ; var=Varb ; Labels=c1,c2,c3,b0,b1,b2,b3,b4,b5,b6,b7 $
?-----------------------------------------------------------------------
? 7 lags, 4th order PDL, OLS dummies sum to zero. Wald shows 4th
? quarterly dummy, F test tests restrictions of the PDL
? Also displays number of restrictions and critical value for test
?-----------------------------------------------------------------------
Sample ; 1 - 36 $
Create ; X=PDL(7,4) $
Sample ; 8-36 $
Regress; Lhs=Y ; Rhs = dq1,dq2,dq3,xpdl ; Res=updl $
Wald ; Fn1 = -c1-c2-c3
; Start = b ; var=Varb ; Labels=c1,c2,c3,b0,b1,b2,b3,b4$
Calc ; List ; EEPDL=Sumsqdev ; DFPDL=Degfrdm
; Ftest = ((eepdl-ee0)/(dfpdl-df0))/(ee0/df0) $
Calc ; List ; rstpdl=dfpdl-df0
; ftb(.95,rstpdl,df0)$
/*
?-----------------------------------------------------------------------
? PDL, MLE, dummies sum to zero. Repeats previous, using MLE for AR(1)
?-----------------------------------------------------------------------
Regress; Lhs=Y ; Rhs = dq1,dq2,dq3,xpdl ;AR1;ALG=MLE $
Wald ; Fn1 = -c1-c2-c3
; Start = b ; var=Varb ; Labels=c1,c2,c3,b0,b1,b2,b3,b4$
?-----------------------------------------------------------------------
? PDL OLS with endpoint constraints. Adds two restrictions to previous.
? Computes Durbin Watson statistic on the side.
? F test is for endpoint restrictions+PDL, vs. unrestricted
?-----------------------------------------------------------------------
Regress; Lhs=Y ; Rhs = dq1,dq2,dq3,xpdl ;
; cls:b(4)- b(5)+ b(6)- b(7)+ b(8)=0,
b(4)+8b(5)+64b(6)+512b(7)+4096b(8)=0 ; res=ue $
Create ; due = ue-ue[-1] $
Create ; If(_Obsno = 1)due=0 $
Calc ; List ; DW = due'due/ue'ue
; eeend=sumsqdev ; dfend= degfrdm $
; Ftest = ((eeend-ee0)/(dfend-df0))/(ee0/df0) $
; rstend=dfend-df0
; ftb(.95,rstend,df0)$
?-----------------------------------------------------------------------
? ML, force dummies to sum to 0 and endpoint constraints. Same as
? previous model. Not actually the full maximum, as it takes the
? unrestricted MLE and does the constrained LS manipulation. Not quite
? the same answer that would be obtained by maximizing the log
? likelihood subject to the constraints.
?-----------------------------------------------------------------------
Regress ; Lhs=y ; Rhs=dq1,dq2,dq3,xpdl
; Cls:b(4)- b(5)+ b(6)- b(7)+ b(8)=0,
b(4)+8b(5)+64b(6)+512b(7)+4096b(8)=0
; Alg=mle;ar1$
Wald ; Fn1 = -c1-c2-c3
; Start = b ; var=Varb ; Labels=c1,c2,c3,b0,b1,b2,b3,b4$
?-----------------------------------------------------------------------
? Unrestricted, by OLS, quarterly dummies sum to 0.
? Wald command displays 4th quarter dummy coefficient
?-----------------------------------------------------------------------
+-----------------------------------------------------------------------+
| Linearly restricted regression |
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = Y Mean= 2568.310345 , S.D.= 468.6928711 |
| Model size: Observations = 29, Parameters = 11, Deg.Fr.= 18 |
| Residuals: Sum of squares= 498522.8320 , Std.Dev.= 166.42029 |
| Fit: R-squared= .918951, Adjusted R-squared = .87392 |
| (Note: Not using OLS. R-squared is not bounded in [0,1] |
| Model test: F[ 10, 18] = 20.41, Prob value = .00000 |
| Diagnostic: Log-L = -182.5548, Restricted(b=0) Log-L = -218.9889 |
| LogAmemiyaPrCrt.= 10.551, Akaike Info. Crt.= 13.349 |
| Note, when restrictions are imposed, R-squared can be less than zero. |
| F[ 1, 17] for the restrictions = 4.4898, Prob = .0491 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Q1 -2.965392153 56.717708 -.052 .9589 .24137931
Q2 -5.435907920 56.773149 -.096 .9248 .24137931
Q3 -23.31070641 56.927696 -.409 .6873 .24137931
Q4 31.71200649 54.884224 .578 .5710 .27586207
X0 .4012336982E-01 .11117932 .361 .7226 2686.1379
X1 .1096529722 .20276310 .541 .5957 2659.0345
X2 .1893346118 .21283934 .890 .3861 2630.4828
X3 .2226823056 .20741952 1.074 .2980 2610.2414
X4 .7031432835E-01 .21903168 .321 .7521 2598.6207
X5 .6417406351E-01 .23791115 .270 .7906 2585.8276
X6 .1392670483 .22834652 .610 .5500 2578.7586
X7 .1461447708 .11821781 1.236 .2332 2555.9655
DW = .40639566470201790D+00
EE0 = .49852283195910020D+06
DF0 = .18000000000000000D+02
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
|for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) .9816934704 .11812112E-01 83.109 .0000
?-----------------------------------------------------------------------
? Unrestricted, by MLE for AR(1) model, quarterly dummies sum to 0.
?-----------------------------------------------------------------------
+---------------------------------------------+
| AR(1) Model: e(t) = rho * e(t-1) + u(t) |
| Initial value of rho = .79680 |
| Maximum iterations = 20 |
| Iter= 3, SS= 178316.179, Log-L=-168.223705 |
| Final value of Rho = .82721 |
| Durbin-Watson: e(t) = .34525 |
| Std. Deviation: e(t) = 177.13626 |
| Std. Deviation: u(t) = 99.53117 |
| Durbin-Watson: u(t) = .97358 |
| Autocorrelation: u(t) = .51321 |
| N[0,1] used for significance levels |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 1.007468597 24.134698 .042 .9667 -.34482759E-01
DQ2 -.5115678532 24.057482 -.021 .9830 -.34482759E-01
DQ3 -14.80867032 24.344053 -.608 .5430 -.34482759E-01
X0 .6488055853E-01 .64217541E-01 1.010 .3123 2686.1379
X1 .9048646927E-01 .80716466E-01 1.121 .2623 2659.0345
X2 .1989209731 .80926132E-01 2.458 .0140 2630.4828
X3 .2182815558 .81557099E-01 2.676 .0074 2610.2414
X4 .9179705519E-01 .87822985E-01 1.045 .2959 2598.6207
X5 .7356818583E-01 .92089866E-01 .799 .4244 2585.8276
X6 .1399610544 .91125348E-01 1.536 .1246 2578.7586
X7 .1133579483 .68466184E-01 1.656 .0978 2555.9655
RHO .8272116490 .10618732 7.790 .0000
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions and joint test of |
| nonlinear restrictions. |
| Wald Statistic = 787.80988 |
| Prob. from Chi-squared[ 2] = .00000 |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) .9912538005 .35397162E-01 28.004 .0000
Fncn( 2) 14.31276958 24.150911 .593 .5534
?-----------------------------------------------------------------------
? 7 lags, 4th order PDL, OLS dummies sum to zero. Wald shows 4th
? quarterly dummy, F test tests restrictions of the PDL
? Also displays number of restrictions and critical value for test
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = Y Mean= 2568.310345 , S.D.= 468.6928711 |
| Model size: Observations = 29, Parameters = 8, Deg.Fr.= 21 |
| Residuals: Sum of squares= 506077.3496 , Std.Dev.= 155.23827 |
| Fit: R-squared= .917722, Adjusted R-squared = .89030 |
| Diagnostic: Log-L = -182.7729, Restricted(b=0) Log-L = -218.9889 |
| Autocorrel: Durbin-Watson Statistic = .44507, Rho = .77747 |
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 -6.982987739 50.756514 -.138 .8919 -.34482759E-01
DQ2 -8.758911609 51.630040 -.170 .8669 -.34482759E-01
DQ3 -15.70362673 50.940622 -.308 .7609 -.34482759E-01
X000 .2653100214E-01 .84772538E-01 .313 .7574 20905.069
X001 .1656054044 .36738667 .451 .6568 72438.655
X002 -.5138057795E-01 .25260637 -.203 .8408 360974.38
X003 .3495534355E-02 .56925288E-01 .061 .9516 2017427.6
X004 .1251824118E-03 .40451237E-02 .031 .9756 12016510.
Polynomial Distributed Lag for X
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 .2653E-01 .8477E-01 .31 .7574| |** |
1 .1444 .9287E-01 1.55 .1350| |************* |
2 .1822 .4856E-01 3.75 .0012| |******** |
3 .1654 .5711E-01 2.90 .0086| |***** |
4 .1226 .5829E-01 2.10 .0476| |*** |
5 .8522E-01 .4648E-01 1.83 .0809| |** |
6 .8773E-01 .9065E-01 .97 .3441| |** |
7 .1677 .8214E-01 2.04 .0540| |*** |
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 .2653E-01 .8477E-01 .31 .7574| |* |
1 .1709 .4924E-01 3.47 .0023| |*** |
2 .3531 .6340E-01 5.57 .0000| |****** |
3 .5185 .4131E-01 12.55 .0000| |******** |
4 .6412 .6237E-01 10.28 .0000| |********** |
5 .7264 .4995E-01 14.54 .0000| |************ |
6 .8141 .8127E-01 10.02 .0000| |************* |
7 .9818 .1100E-01 89.26 .0000| |****************|
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) 31.44552608 50.203278 .626 .5311
FTEST = .10449316411388680D+00
EEPDL= .50607734960866870D+06
DFPDL = .21000000000000000D+02
FTEST = .90922828387383210D-01
RSTPDL = .30000000000000040D+01
Result = .31599075898100000D+01
?-----------------------------------------------------------------------
? PDL, MLE, dummies sum to zero. Repeats previous, using MLE for AR(1)
?-----------------------------------------------------------------------
+---------------------------------------------+
| AR(1) Model: e(t) = rho * e(t-1) + u(t) |
| Initial value of rho = .77747 |
| Maximum iterations = 20 |
| Iter= 3, SS= 195356.806, Log-L=-169.488160 |
| Final value of Rho = .80296 |
| Durbin-Watson: e(t) = .38316 |
| Std. Deviation: e(t) = 161.82063 |
| Std. Deviation: u(t) = 96.45053 |
| Durbin-Watson: u(t) = 1.18194 |
| Autocorrelation: u(t) = .40903 |
| N[0,1] used for significance levels |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 -5.948621996 22.594018 -.263 .7923 -.34482759E-01
DQ2 -3.002142403 23.089429 -.130 .8965 -.34482759E-01
DQ3 -6.406661309 22.679601 -.282 .7776 -.34482759E-01
X000 .5876761171E-01 .57750452E-01 1.018 .3089 20905.069
X001 .8394877499E-01 .19870950 .422 .6727 72438.655
X002 -.8972580989E-02 .13356822 -.067 .9464 360974.38
X003 -.3720177038E-02 .30081841E-01 -.124 .9016 2017427.6
X004 .5007799951E-03 .21487163E-02 .233 .8157 12016510.
RHO .8029595037 .11263976 7.129 .0000
Polynomial Distributed Lag for X
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 .5877E-01 .5775E-01 1.02 .3089| |****** |
1 .1305 .5073E-01 2.57 .0101| |*********** |
2 .1690 .3207E-01 5.27 .0000| |******** |
3 .1700 .3470E-01 4.90 .0000| |***** |
4 .1411 .3371E-01 4.19 .0000| |*** |
5 .1022 .3218E-01 3.17 .0015| |** |
6 .8490E-01 .5087E-01 1.67 .0952| |** |
7 .1331 .6008E-01 2.22 .0267| |** |
+----------------+----------------+
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 .5877E-01 .5775E-01 1.02 .3089| |* |
1 .1893 .5000E-01 3.79 .0002| |*** |
2 .3583 .5247E-01 6.83 .0000| |****** |
3 .5283 .4638E-01 11.39 .0000| |********* |
4 .6694 .5268E-01 12.71 .0000| |*********** |
5 .7716 .5127E-01 15.05 .0000| |************ |
6 .8565 .6339E-01 13.51 .0000| |************** |
7 .9896 .3072E-01 32.21 .0000| |****************|
+----------------+----------------+
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) 15.35742571 23.325011 .658 .5103
?-----------------------------------------------------------------------
? PDL OLS with endpoint constraints. Adds two restrictions to previous.
? Computes Durbin Watson statistic on the side.
? F test is for endpoint restrictions+PDL, vs. unrestricted
?-----------------------------------------------------------------------+
| Linearly restricted regression |
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = Y Mean= 2568.310345 , S.D.= 468.6928711 |
| Model size: Observations = 29, Parameters = 6, Deg.Fr.= 23 |
| Residuals: Sum of squares= 552180.3622 , Std.Dev.= 154.94464 |
| Fit: R-squared= .910227, Adjusted R-squared = .89071 |
| (Note: Not using OLS. R-squared is not bounded in [0,1] |
| Model test: F[ 5, 23] = 46.64, Prob value = .00000 |
| Diagnostic: Log-L = -184.0371, Restricted(b=0) Log-L = -218.9889 |
| LogAmemiyaPrCrt.= 10.274, Akaike Info. Crt.= 13.106 |
| Note, when restrictions are imposed, R-squared can be less than zero. |
| F[ 2, 21] for the restrictions = .9565, Prob = .4003 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 -13.30190003 50.453240 -.264 .7946 -.34482759E-01
DQ2 -7.017022701 50.455268 -.139 .8907 -.34482759E-01
DQ3 -7.627468222 50.449535 -.151 .8813 -.34482759E-01
X000 .8681153894E-01 .20857921E-01 4.162 .0004 20905.069
X001 .5665643950E-01 .51311122E-02 11.042 .0000 72438.655
X002 -.2487724124E-01 .14309839E-01 -1.738 .0968 360974.38
X003 .4919745568E-02 .39636114E-02 1.241 .2282 2017427.6
X004 -.3581126334E-03 .28237345E-03 -1.268 .2186 12016510.
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 .8681E-01 .2086E-01 4.16 .0004| |********** |
1 .1232 .1438E-01 8.56 .0000| |********* |
2 .1342 .1155E-01 11.62 .0000| |****** |
3 .1367 .2044E-01 6.69 .0000| |***** |
4 .1386 .2045E-01 6.78 .0000| |**** |
5 .1393 .1165E-01 11.96 .0000| |*** |
6 .1297 .1458E-01 8.90 .0000| |** |
7 .9207E-01 .2097E-01 4.39 .0003| |** |
+----------------+----------------+
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 .8681E-01 .2086E-01 4.16 .0004| |* |
1 .2100 .3450E-01 6.09 .0000| |*** |
2 .3442 .3446E-01 9.99 .0000| |****** |
3 .4809 .3082E-01 15.60 .0000| |******** |
4 .6195 .3430E-01 18.06 .0000| |********** |
5 .7588 .3451E-01 21.99 .0000| |************ |
6 .8885 .2203E-01 40.33 .0000| |************** |
7 .9806 .1091E-01 89.85 .0000| |****************|
+----------------+----------------+
DW = .43219363097339080D+00
EEEND = .55218036222191830D+06
DFEND = .23000000000000000D+02
FTEST = .38747896096761420D+00
RSTEND = .50000000000000000D+01
Result = .27728531530000010D+01
?-----------------------------------------------------------------------
? ML, force dummies to sum to 0 and endpoint constraints. Same as
? previous model. Not actually the full maximum, as it takes the
? unrestricted MLE and does the constrained LS manipulation. Not quite
? the same answer that would be obtained by maximizing the log
? likelihood subject to the constraints.
?-----------------------------------------------------------------------
+---------------------------------------------+
| AR(1) Model: e(t) = rho * e(t-1) + u(t) |
| Initial value of rho = .77747 |
| Maximum iterations = 20 |
| Iter= 3, SS= 195356.806, Log-L=-169.488160 |
| Final value of Rho = .80296 |
| Durbin-Watson: e(t) = .38316 |
| Std. Deviation: e(t) = 161.82063 |
| Std. Deviation: u(t) = 96.45053 |
| Durbin-Watson: u(t) = 1.18194 |
| Autocorrelation: u(t) = .40903 |
| N[0,1] used for significance levels |
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 -5.948621996 22.594018 -.263 .7923 -.34482759E-01
DQ2 -3.002142403 23.089429 -.130 .8965 -.34482759E-01
DQ3 -6.406661309 22.679601 -.282 .7776 -.34482759E-01
X000 .5876761171E-01 .57750452E-01 1.018 .3089 20905.069
X001 .8394877499E-01 .19870950 .422 .6727 72438.655
X002 -.8972580989E-02 .13356822 -.067 .9464 360974.38
X003 -.3720177038E-02 .30081841E-01 -.124 .9016 2017427.6
X004 .5007799951E-03 .21487163E-02 .233 .8157 12016510.
RHO .8029595037 .11263976 7.129 .0000
Polynomial Distributed Lag for X
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 .5877E-01 .5775E-01 1.02 .3089| |****** |
1 .1305 .5073E-01 2.57 .0101| |*********** |
2 .1690 .3207E-01 5.27 .0000| |******** |
3 .1700 .3470E-01 4.90 .0000| |***** |
4 .1411 .3371E-01 4.19 .0000| |*** |
5 .1022 .3218E-01 3.17 .0015| |** |
6 .8490E-01 .5087E-01 1.67 .0952| |** |
7 .1331 .6008E-01 2.22 .0267| |** |
+----------------+----------------+
Polynomial Distributed Lag for X
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 .5877E-01 .5775E-01 1.02 .3089| |* |
1 .1893 .5000E-01 3.79 .0002| |*** |
2 .3583 .5247E-01 6.83 .0000| |****** |
3 .5283 .4638E-01 11.39 .0000| |********* |
4 .6694 .5268E-01 12.71 .0000| |*********** |
5 .7716 .5127E-01 15.05 .0000| |************ |
6 .8565 .6339E-01 13.51 .0000| |************** |
7 .9896 .3072E-01 32.21 .0000| |****************|
+----------------+----------------+
+-----------------------------------------------------------------------+
| Linearly restricted regression |
| Generalized least squares regression Weighting variable = none |
| Dep. var. = Y Mean= 2568.310345 , S.D.= 468.6928711 |
| Model size: Observations = 29, Parameters = 6, Deg.Fr.= 23 |
| Residuals: Sum of squares= 600399.1491 , Std.Dev.= 161.56829 |
| Fit: R-squared= .902388, Adjusted R-squared = .88117 |
| (Note: Not using OLS. R-squared is not bounded in [0,1] |
| Model test: F[ 5, 23] = 42.53, Prob value = .00000 |
| Diagnostic: Log-L = -185.2510, Restricted(b=0) Log-L = -218.9889 |
| LogAmemiyaPrCrt.= 10.358, Akaike Info. Crt.= 13.190 |
| Note, when restrictions are imposed, R-squared can be less than zero. |
| F[ 2, 21] for the restrictions = .6857, Prob = .5146 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
DQ1 -7.957061800 22.513739 -.353 .7273 -.34482759E-01
DQ2 -3.353494482 22.455568 -.149 .8827 -.34482759E-01
DQ3 -4.152770819 22.500234 -.185 .8553 -.34482759E-01
X000 .9021824328E-01 .23341667E-01 3.865 .0009 20905.069
X001 .6242829710E-01 .73869286E-02 8.451 .0000 72438.655
X002 -.2364934860E-01 .15137359E-01 -1.562 .1332 360974.38
X003 .3881033284E-02 .41058500E-02 .945 .3553 2017427.6
X004 -.2595642947E-03 .29168922E-03 -.890 .3836 12016510.
Lag Weights Std. Err. t-ratio Prob. Distribution of Weights (about 0.0)
-----------------------------------------+----------------+----------------+
0 .9022E-01 .2334E-01 3.87 .0009| |********** |
1 .1326 .1858E-01 7.14 .0000| |********** |
2 .1474 .1464E-01 10.06 .0000| |****** |
3 .1484 .2130E-01 6.97 .0000| |***** |
4 .1435 .2133E-01 6.73 .0000| |*** |
5 .1340 .1479E-01 9.06 .0000| |*** |
6 .1153 .1874E-01 6.16 .0000| |** |
7 .7638E-01 .2342E-01 3.26 .0037| |* |
+----------------+----------------+
Lag Sum Wts Std. Err. t-ratio Prob. Distribution of Sum Wts (about 0.0)
-----------------------------------------+----------------+----------------+
0 .9022E-01 .2334E-01 3.87 .0009| |* |
1 .2228 .4095E-01 5.44 .0000| |**** |
2 .3702 .4584E-01 8.08 .0000| |****** |
3 .5186 .4553E-01 11.39 .0000| |******** |
4 .6621 .4703E-01 14.08 .0000| |*********** |
5 .7961 .4459E-01 17.86 .0000| |************* |
6 .9115 .3420E-01 26.65 .0000| |*************** |
7 .9878 .3065E-01 32.22 .0000| |****************|
+----------------+----------------+
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions and joint test of |
| nonlinear restrictions. |
| Wald Statistic = .47824 |
| Prob. from Chi-squared[ 1] = .48922 |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) 15.46332710 22.360467 .692 .4892
/*=================================================================
Example 17.3. Price and Income Elasticities of Demand for Gasoline
*/=================================================================
?
? Data setup is in Example 17.2.
?
?---------------------------------------------------------------------------
? Unrestricted model
?---------------------------------------------------------------------------
Sample ; 6 - 36 $
Regress ; Lhs = lg
; Rhs = One,lpnc,lpuc,lppt,t,
lpg,lp1,lp2,lp3,lp4,lp5,ly,ly1,ly2,ly3,ly4,ly5 $
Calc ; List ; N ; Sumsqdev $
Wald ; Fn1=b6+b7+b8+b9+b10+b11
; Fn2=b12+b13+b14+b15+b16+b17;
; Start=b ; Var=Varb ; Labels=17_b$
?---------------------------------------------------------------------------
? Nonlinear Least Squares Estimation for Expectations Model.
?---------------------------------------------------------------------------
Sample ; 1 - 36 $
Namelist ; Xdl=one,LPnc,LPuc,LPpt,t $
Matrix ; EE = 0.0[99,1] ; LL = EE$
Calc ; J=0 ; Smallee=1000000$
Procedure
Create ; If(_obsno=1)| ztp=lpg/(1-lambda) ; zty=ly/(1-lambda)
; dtp=ztp/(1-lambda) ; dty=zty/(1-lambda)$
Create ; If(_obsno>1)| ztp=lpg+lambda*ztp[-1]
; zty=ly+lambda*zty[-1]
; dtp=ztp[-1]+lambda*dtp[-1]
; dty=zty[-1]+lambda*dty[-1] $
Calc ; Sume2=Ess(XDL,ZtP,ZtY,LG) ; j=j+1
; If(Sume2 < Smallee) | Smallee=sume2 ; Best=lambda$
Matrix ; EE(j)=Sume2 ; LL(j)=Lambda$
Endproc
Execute ; Lambda=.01,.99,.01$
Mplot ; Lhs=LL ; Rhs=EE ; Fill ; Grid ; Endpoints = 0,1$
Calc ; j=1 ; List ; N; Smallee $
Execute ; Lambda=Best $
Namelist ; X=Xdl,ztp,zty $
Matrix ; Beta=<X’X>*X’Lg $
Create ; dt=Beta(6)*dtp + Beta(7)*dty $
Namelist ; X0=X,dt$
Matrix ; Beta = [Beta/Lambda] ; V=ssqrd*<X0’X0> ; Stat(Beta,V)$
Wald ; Start=Beta ; Var=V ; Labels=b1,b2,b3,b4,b5,b6,b7,Lm
; Fn1=b6/(1-Lm) ; Fn2=b7/(1-Lm)$
?---------------------------------------------------------------------------
? Partial Adjustment Model
?---------------------------------------------------------------------------
Sample ; 2 - 36 $
Regress ; Lhs = Lg ; Rhs = One,lpnc,lpuc,lppt,t,lpg,ly,lg1 $
Calc ; List ; N ; Sumsqdev $
Wald ; Fn1 = b6/(1-b8) ; fn2=b7/(1-b8)
; Start = b ; Var = Varb ; Labels = 8_b $
/*
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = LG Mean= 4.649873861 , S.D.= .9622470146E-01 |
| Model size: Observations = 31, Parameters = 17, Deg.Fr.= 14 |
| Residuals: Sum of squares= .1649508460E-02, Std.Dev.= .01085 |
| Fit: R-squared= .994062, Adjusted R-squared = .98728 |
| Model test: F[ 16, 14] = 146.47, Prob value = .00000 |
| Diagnostic: Log-L = 108.5525, Restricted(b=0) Log-L = 29.0943 |
| LogAmemiyaPrCrt.= -8.609, Akaike Info. Crt.= -5.907 |
| Autocorrel: Durbin-Watson Statistic = 1.41757, Rho = .29121 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -18.16520769 .94287398 -19.266 .0000
LPNC .1869545562 .93945297E-01 1.990 .0665 .50841999
LPUC .8002558141E-01 .78781503E-01 1.016 .3270 .78396138
LPPT -.7537782793E-01 .74139645E-01 -1.017 .3265 .92045241
T -.3359358417E-01 .64073728E-02 -5.243 .0001 21.000000
LPG -.2086637792 .30323252E-01 -6.881 .0000 .79662045
LP1 -.1325136220 .55849246E-01 -2.373 .0325 .75074862
LP2 .8196540286E-01 .48010410E-01 1.707 .1098 .70550661
LP3 .2578197557E-02 .49143648E-01 .052 .9589 .66046438
LP4 -.5847635591E-01 .45473147E-01 -1.286 .2193 .61491769
LP5 .4547743059E-01 .51710643E-01 .879 .3940 .56962818
LY .7851237820 .25909796 3.030 .0090 9.1694046
LY1 -.1384356575E-01 .28699331 -.048 .9622 9.1509123
LY2 .6963302390 .25887627 2.690 .0176 9.1315171
LY3 .8757028834E-01 .29113384 .301 .7680 9.1120229
LY4 .2586348681 .24466791 1.057 .3084 9.0917336
LY5 .7791365084 .20573492 3.787 .0020 9.0715858
Sample N= .31000000000000000D+02
SUMSQDEV= .16495084603249600D-02
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) -.2696327261 .89234076E-01 -3.022 .0025
Fncn( 2) 2.592952120 .10894073 23.801 .0000
Matrix statistical results: Coefficients=BETA Variance=V
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
BETA _ 1 -18.08046378 .79502160 -22.742 .0000
BETA _ 2 -.5918967014E-01 .52728654E-01 -1.123 .2616
BETA _ 3 .3704753603 .39918390E-01 9.281 .0000
BETA _ 4 .1156824825 .37962917E-01 3.047 .0023
BETA _ 5 -.3986080333E-01 .34334562E-02 -11.610 .0000
BETA _ 6 -.1707701991 .11935034E-01 -14.308 .0000
BETA _ 7 .8770521469 .43784364E-01 20.031 .0000
BETA _ 8 .6600000000 .13903179E-01 47.471 .0000
Sample N= .36000000000000000D+02
SMALLEE = .98409285675415960D-02
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) -.5022652916 .44594609E-01 -11.263 .0000
Fncn( 2) 2.579565138 .92256903E-01 27.961 .0000
+-----------------------------------------------------------------------+
| Ordinary least squares regression Weighting variable = none |
| Dep. var. = LG Mean= 4.610830309 , S.D.= .1429479464 |
| Model size: Observations = 35, Parameters = 8, Deg.Fr.= 27 |
| Residuals: Sum of squares= .1250433996E-01, Std.Dev.= .02152 |
| Fit: R-squared= .982002, Adjusted R-squared = .97734 |
| Model test: F[ 7, 27] = 210.45, Prob value = .00000 |
| Diagnostic: Log-L = 89.2351, Restricted(b=0) Log-L = 18.9290 |
| LogAmemiyaPrCrt.= -7.472, Akaike Info. Crt.= -4.642 |
| Autocorrel: Durbin-Watson Statistic = 1.63910, Rho = .18045 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant -5.133074868 1.9252433 -2.666 .0128
LPNC -.1385850117 .13860763 -1.000 .3263 .45460339
LPUC .1262311395 .73788044E-01 1.711 .0986 .68769049
LPPT .5086530758E-01 .64897450E-01 .784 .4400 .80016275
T -.1056855906E-01 .54108460E-02 -1.953 .0612 19.000000
LPG -.1181728771 .25249203E-01 -4.680 .0001 .69558165
LY .7717496814 .26878032 2.871 .0079 9.1225115
LG1 .6355402720 .12455748 5.102 .0000 4.5978268
Sample N= .35000000000000000D+02
SUMSQDEV= .12504339955516810D-01
+-----------------------------------------------+
| WALD procedure. Estimates and standard errors |
| for nonlinear functions |
+-----------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Fncn( 1) -.3242412481 .13403797 -2.419 .0156
Fncn( 2) 2.117517032 .41434438 5.111 .0000
*/
/*=================================================================
Example 17.4. Lag Weights in a Rational Lag Model
*/=================================================================
Read ; Nobs = 128 ; Nvar = 3 ; Names = 1 $
Quarter C Y
1953.1 362.8 395.5
1953.2 364.6 401.0
1953.3 363.6 399.7
1953.4 362.6 400.2
1954.1 363.5 399.7
1954.2 366.2 397.3
1954.3 371.8 403.8
1954.4 378.6 411.8
1955.1 385.2 414.7
1955.2 392.2 423.8
1955.3 396.4 430.8
1955.4 402.6 437.6
1956.1 403.2 441.2
1956.2 403.9 444.7
1956.3 405.1 446.6
1956.4 409.3 452.7
1957.1 411.7 452.6
1957.2 412.4 455.4
1957.3 415.2 457.9
1957.4 416.0 456.0
1958.1 411.0 452.1
1958.2 414.7 455.1
1958.3 420.9 464.6
1958.4 425.2 471.3
1959.1 424.1 474.5
1959.2 439.7 482.2
1959.3 443.3 479.0
1959.4 444.6 483.1
1960.1 448.1 487.8
1960.2 454.1 490.7
1960.3 452.7 491.0