wendyliu919 发表于 2010-5-23 22:09 
请问高手们在用sas做非线性回归拟合的时候怎样才能有拟合曲线图?
You may save the fitting value within a precudure, then graph it in poc gplot.
Here is an example,
title 'U.S. Population Growth';
data uspop;
input pop :6.3 @@;
retain year 1780;
year = year+10;
yearsq = year*year;
datalines;
3929 5308 7239 9638 12866 17069 23191 31443 39818 50155
62947 75994 91972 105710 122775 131669 151325 179323 203211
226542 248710
;
title 'Beaton/Tukey Biweight Robust Regression using IRLS';
proc nlin data=uspop nohalve;
parms b0=20450.43 b1=-22.7806 b2=.0063456;
model pop=b0+b1*year+b2*year*year;
resid = pop-model.pop;
sigma = 2;
k = 4.685;
if abs(resid/sigma)<=k then _weight_=(1-(resid / (sigma*k))**2)**2;
else _weight_=0;
output out=c r=rbi p=pop_pred;
run;
proc print; run;
symbol1 i=join v=square color=green ;
symbol2 i=join v=circle color=red;
proc gplot data=c;
plot (pop pop_pred)*year/overlay legend;
run;
quit;