Money Demand Model

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: pdlex02.sas
 Description: Example program from SAS/ETS User's Guide,
              The PDLREG Procedure
       Title: Money Demand Model
     Product: SAS/ETS Software
        Keys: time series with distributed lags
        PROC: PDLREG
       Notes:

--------------------------------------------------------------*/

   title 'Money Demand Estimation using Distributed Lag Model';
   title2 'Quarterly Data - 1968Q2 to 1983Q4';

data a;
   input m1 gnp gdf r @@;
   m    = log( 100 * m1 / gdf );
   lagm = lag( m );
   y    = log( gnp );
   p    = log( gdf / lag( gdf ) );
   date = intnx( 'qtr', '1jan1968'd, _n_-1 );
   format date yyqc6.;
   label m    = 'Real Money Stock (M1)'
         lagm = 'Lagged Real Money Stock'
         y    = 'Real GNP'
         r    = 'Commercial Paper Rate'
         p    = 'Inflation Rate';
datalines;
187.15  1036.22    81.18     5.58
190.63  1056.02    82.12     6.08
194.30  1068.72    82.80     5.96
198.55  1071.28    84.04     5.96
201.73  1084.15    84.97     6.66
203.18  1088.73    86.10     7.54
204.18  1091.90    87.49     8.49
206.10  1085.53    88.62     8.62
207.90  1081.32    89.89     8.55
209.78  1083.01    91.07     8.17
212.78  1093.37    91.79     7.84
216.08  1084.60    93.03     6.29
220.28  1111.55    94.40     4.59
225.25  1116.93    95.70     5.04
228.45  1125.78    96.52     5.74
230.70  1135.43    97.39     5.07
235.60  1157.21    98.72     4.06
239.38  1178.54    99.42     4.58
244.55  1193.12   100.25     4.94
250.70  1214.79   101.54     5.33
254.80  1246.72   102.95     6.28
258.40  1248.31   104.75     7.47
261.03  1255.70   106.53     9.87
264.68  1266.05   108.74     8.98
268.77  1253.34   110.72     8.30
271.23  1254.67   113.48    10.46
273.73  1246.86   116.42    11.53
276.73  1230.32   119.79     9.05
278.75  1204.26   122.88     6.56
283.80  1218.82   124.44     5.92
288.13  1246.05   126.68     6.67
290.88  1257.31   128.99     6.12
295.18  1284.97   130.12     5.29
299.53  1293.68   131.30     5.57
303.35  1301.08   132.89     5.53
309.35  1313.06   134.99     4.99
316.55  1341.23   136.80     4.81
321.80  1363.28   139.01     5.24
327.60  1385.80   141.03     5.81
334.80  1388.51   143.24     6.59
341.13  1400.01   145.12     6.80
348.70  1436.97   148.89     7.20
355.45  1448.82   152.02     8.08
361.38  1468.40   155.38     9.90
367.08  1472.57   158.60    10.10
376.10  1469.20   161.85    10.03
384.58  1486.59   165.13    10.60
388.38  1489.38   168.05    13.10
394.30  1496.40   171.94    14.25
390.00  1461.40   176.46    10.62
405.50  1464.20   180.24     9.65
416.10  1477.90   185.13    14.51
420.90  1513.50   190.01    14.52
429.30  1511.70   193.03    15.35
432.60  1522.10   197.71    16.27
437.50  1501.30   201.69    12.94
448.80  1483.50   203.98    13.70
451.30  1480.50   206.77    13.48
458.20  1477.10   208.52    11.53
475.70  1478.80   210.28     8.81
490.90  1491.00   212.86     8.34
505.20  1524.80   214.26     8.61
517.20  1550.20   215.88     9.44
523.40  1572.70   218.20     9.19
;

proc print data=a(obs=5);
   var date m lagm y r p;
run;

proc pdlreg data=a;
   model m = lagm y(5,3) r(2, , ,first) p(3,2) / lagdep=lagm;
run;