/* Unbalanced (Spurious) Regression Simulation */
/* Inconsistency of Estimating 'Unbalanced' equations */
/* Estimate y = I(1) vs. x = I(0) when the true equation is
dy = I(0) vs. x = I(0) */
/* Tom Fomby, Dept. of Economics, SMU, Dallas, TX 75275 */
data rw;
seedy=333333;
seedx=444444;
do sample = 1 to 20;
y = 0;
do time = 1 to 600;
x = 0.00 + rannor(seedx);
dy = 1.0 + 1*x + rannor(seedy);
y = dy + y;
if time > 500 then output;
end;
end;
run;
/* run unbalanced and balanced regressions by sample */
proc reg data=rw;
model y = x;
model dy = x;
by sample;
run;