| The MODEL Procedure |
This example illustrates how to use SMM to estimate a simple linear regression model for the following process:
![]() |
In the following SAS statements,
is simulated, and the first moment and the second moment of
are compared with those of the observed endogenous variable
.
title "Simple regression model";
data regdata;
do i=1 to 500;
x = rannor( 1013 );
Y = 2 + 1.5 * x + 1.5 * rannor( 1013 );
output;
end;
run;
proc model data=regdata;
parms a b s;
instrument x;
ysim = (a+b*x) + s * rannor( 8003 );
y = ysim;
eq.ysq = y*y - ysim*ysim;
fit y ysq / gmm ndraw;
bound s > 0;
run;
Alternatively, the MOMENT statement can be used to specify the moments using the following syntax:
proc model data=regdata; parms a b s; instrument x; ysim = (a+b*x) + s * rannor( 8003 ); y = ysim; moment y = (2); fit y / gmm ndraw; bound s > 0; run;
The output of the MODEL procedure is shown in Output 18.15.1:
| Model Summary | |
|---|---|
| Model Variables | 1 |
| Parameters | 3 |
| Equations | 2 |
| Number of Statements | 4 |
Copyright © SAS Institute, Inc. All Rights Reserved.