|
Chapter Contents |
Previous |
Next |
| The MODEL Procedure |
This example shows the use of the %PDL macro for polynomial distributed lag models. Simulated data is generated so that Y is a linear function of six lags of X, with the lag coefficients following a quadratic polynomial. The model is estimated using a fourth-degree polynomial, both with and without endpoint constraints. The example uses simulated data generated from the following model:

The LIST option prints the model statements added by the %PDL macro.
/*--------------------------------------------------------------*/
/* Generate Simulated Data for a Linear Model with a PDL on X */
/* y = 10 + x(6,2) + e */
/* pdl(x) = -5.*(lg)**2 + 1.5*(lg) + 0. */
/*--------------------------------------------------------------*/
data pdl;
pdl2=-5.; pdl1=1.5; pdl0=0;
array zz(i) z0-z6;
do i=1 to 7;
z=i-1;
zz=pdl2*z**2 + pdl1*z + pdl0;
end;
do n=-11 to 30;
x =10*ranuni(1234567)-5;
pdl=z0*x + z1*xl1 + z2*xl2 + z3*xl3 + z4*xl4 + z5*xl5 + z6*xl6;
e =10*rannor(123);
y =10+pdl+e;
if n>=1 then output;
xl6=xl5; xl5=xl4; xl4=xl3; xl3=xl2; xl2=xl1; xl1=x;
end;
run;
title1 'Polynomial Distributed Lag Example';
title3 'Estimation of PDL(6,4) Model-- No Endpoint Restrictions';
proc model data=pdl;
parms int; /* declare the intercept parameter */
%pdl( xpdl, 6, 4 ) /* declare the lag distribution */
y = int + %pdl( xpdl, x ); /* define the model equation */
fit y / list; /* estimate the parameters */
run;
Output 14.5.1: PROC MODEL Listing of Generated Program|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Portions of the output produced by the following PDL model with endpoints of the model restricted to 0 are presented in Output 14.5.3 and Output 14.5.4.
title3 'Estimation of PDL(6,4) Model-- Both Endpoint Restrictions';
proc model data=pdl ;
parms int; /* declare the intercept parameter */
%pdl( xpdl, 6, 4, r=both ) /* declare the lag distribution */
y = int + %pdl( xpdl, x ); /* define the model equation */
fit y /list; /* estimate the parameters */
run;
Output 14.5.3: PROC MODEL Results Specifying Both Endpoint Restrictions|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To estimate the PDL model with one or more of the polynomial terms dropped, specify the largest degree of the polynomial desired with the %PDL macro and use the DROP= option on the FIT statement to remove the unwanted terms. The dropped parameters should be set to 0. The following PROC MODEL code demonstrates estimation with a PDL of degree 2 without the 0th order term.
title3 'Estimation of PDL(6,2) Model-- With XPDL_0 Dropped';
proc model data=pdl list;
parms int; /* declare the intercept parameter */
%pdl( xpdl, 6, 2 ) /* declare the lag distribution */
y = int + %pdl( xpdl, x ); /* define the model equation */
xpdl_0 =0;
fit y drop=xpdl_0; /* estimate the parameters */
run;
The results from this estimation are shown in Output 14.5.4.
Output 14.5.4: PROC MODEL Results Specifying %PDL( XPDL, 6, 2)|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.