我把stkcd转为数值型,结果nobs出来三个变量:type freq nobs, 数值分别为0,13252,13252,。13252是我的总样本量,我求nobs的目的是在下面要用到。多谢解答
data est;
  set three;
  if _n_ > nobs then const=0;
  if _n_ > nobs then X1=0;
  if _n_ > nobs then X2=0;
  if _n_ > nobs then Y=0;
  if _n_ <= nobs then consta=0;
  if _n_ <= nobs then Xa1=0;
  if _n_ <= nobs then Xa2=0;
  title 'UNCONSTRAINED';
run;