1# ch0007in
有y1,y2...,y100, 和x1,x2,...,x100.
model y=lag(x)
怎么用estimated出来的系数和x100,算出y101_hat??
两种方法:
方法1.
data temp;
set temp;
lx=lag(x);
run;
proc reg data=temp;
model y= lx /p;
output out=result p=yp; /*其中yp就是y的预测值*/
run;quit;
方法2:
如果需要预测的数据保存在另外一个数据集可以采用如下程序:
proc reg data=temp outest=estimation;
model y=lx ;
run;quit;
proc score data=tobeforecast score=estimation out=result type=parms predict;
var y lx;
run;