alpha语句
proc reg data=origianl;
ods output nobs=a anova=b fitstatistics=c parameterestimates=d;
model y=x1;
by co;
quit;
data final;
set a(where=(Label="Number of Observations Read") keep=co Label N);
set b(where=(Source="Model") keep=source FValue);
set c(where=(Label2="Adj R-Sq") keep=Label2 nValue2 rename=(nValue2=adj_R_sq));
set d(where=(Variable="Intercept") keep=Variable Estimate tValue Probt rename=(Estimate=alpha tValue=t_alpha Probt=p_alpha));
set d(where=(Variable="X1") keep=Variable Estimate tValue Probt rename=(Estimate=beta1 tValue=t_beta1 Probt=p_beta1));
drop Label Source Label2 Variable;
run;
Newey-west是1987年就出来的方法,在spss里有自带程序。用sas是可以做到的,语句:
Proc model data=original;
Param b0 b1;
y=b0+b1*x1;
fit y/gmm kernel=(bart,1, lnM/lnT);
instruments x1;
by co;
run;