怎么用eviews 做岭回归?跪求

如题所述

Eviews做不了岭回归,SPSS做岭回归的代码如下:
*---------------------------------------------------------------------------.
* Calculate raw coefficients from standardized ones, compute standard errors
* of coefficients, and an intercept term with standard error. Then print
* out similar to REGRESSION output.
*---------------------------------------------------------------------------(从这里开始是给出系数估计)
. compute beta={b;0}.
. compute b= ( b &/ std ) * sy.
. compute intercpt=ybar-t(b)*t(xmean).
. compute b={b;intercpt}.
. compute xpx=(sse/(sst*(n-nv-1)))*inv(xpx+(k &* ident(nv,nv)))*xpx*
inv(xpx+(k &* ident(nv,nv))).
. compute xpx=(sy*sy)*(mdiag(1 &/ std)*xpx*mdiag(1 &/ std)).
. compute seb=sqrt(diag(xpx)).
. compute seb0=sqrt( (sse)/(n*(n-nv-1)) + xmean*xpx*t(xmean)).
. compute seb={seb;seb0}.
. compute rnms={varname,'Constant'}.
. compute ratio=b &/ seb.
. compute ppp=2*(1-tcdf(abs(ratio),n-nv-1)).
. compute bvec={b,seb,beta,ratio,ppp}.
. print bvec/title='--------------Variables in the Equation----------------'
/rnames=rnms /clabels='B' 'SE(B)' 'Beta' 'T' 'sig'.
. print /space=newpage.
end if.追问

不懂,还是不会

温馨提示:答案为网友推荐,仅供参考
相似回答