http://wenku.baidu.com/view/2c9fef86e53a580216fcfe8f.html
个人感觉这里的程序错了。稍微改编了一下输入到电脑里面说是
ERROR: 没有找到期望的分号,系统将不会编译该宏。
ERROR: 将编译哑宏。
data hgfx52;
set quan.hfzy5;
run;
data ww2;
set hgfx52;
array p(10)(-2,-1.5,-1,-0.5,0.5,1,1.5,2,2.5,3);
array row(10)w1-w10;
do i=1 to 10;
row(i)=1/x**p(i);
end;
%macro wls(indata);
%do j=1 %to 10;
%analyse(&indata,&j);
%drawplot(%indata,&j);
%end;
%mend;
%macro analyse(indata,count);
proc reg data=&indata;
model y=x/r;
weight w&count;
output out=ww2 r=resid&count;
%mend;
%macro draw plot(indata,count);
proc gplot data=&indata;
plot resid&count*x;
%mend;
%wls(ww2);
这是我改编的程序,求指教。顺便问一下加权最小二乘回归,怎么编?