Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Program for non-linear regression using SAS data mining; input w d y; x=w/d; cards; 610 550 33.6 450 500 22.3 450 520 22.0 410 800 20.0 430 740 18.7 500 230 31.0 500 235 30.0 500 240 32.0 450 600 26.6 450 650 15.1 480 230 30.0 475 1400 13.5 485 615 26.8 474 515 25.0 485 700 20.4 600 750 15.0 ; /*finding starting values*/ /*model y=a*(1-exp(-b*(x)))*/ proc reg data=mining; model y=x; run; proc nlin data=mining method=gauss outest=origest; parms a=15 b=.5; model y=a*(1-exp(-b*(x))); der.a=(1-exp(-b*(x))); der.b=a*x*(exp(-b*(x))); output out=mout p=yhat r=yresid; run; data outorg; set mout; xorig=x; yorig=y; title 'original'; run; proc print data=outorg; run; proc gplot data=outorg; plot (y yhat)*x/overlay; run; /*other options*/ proc nlin data=mining method=newton outest=origest2; parms a=15 b=.5; model y=a*(1-exp(-b*(x))); output out=mout p=yhat r=yresid; run; proc nlin data=mining method=marquardt outest=origest3; parms a=15 b=.5; model y=a*(1-exp(-b*(x))); output out=mout p=yhat r=yresid; run; proc nlin data=mining method=gradient outest=origest4; parms a=25 b=.5; model y=a*(1-exp(-b*(x))); der.a=(1-exp(-b*(x))); der.b=a*x*(exp(-b*(x))); output out=mout p=yhat r=yresid; run; This program looks at estimation and confidence intervals for the nlin estimates using bootstrap methods. %macro bootstrapreg(original,nb,estimate); data b1; set &original; err1=yresid; keep err1; run; %do i=1 %to &nb; PROC SURVEYSELECT data=b1 METHOD=uRS N=16; OUThits out=outb1&i run; data b2; merge outb1&i &original; keep y x yhat yresid err1; run; data b3; set b2; ynew=yhat+err1; run; proc nlin data=b3 outest=est&i; parms a=15 b=.5; model ynew=a*(1-exp(-b*(x))); der.a=(1-exp(-b*(x))); der.b=a*x*(exp(-b*(x))); run; %end; run; data &estimate; set %do i=1 %to &nb; est&i %end; %mend; %bootstrapreg(outorg,100,estall); run; proc print data=estall; run; data nlinest; set estall; if _TYPE_="FINAL"; run; proc capability data=nlinest noprint; var a b; histogram a b; output out=sumdata mean= am bm std=as1 bs1 2.5 97.5 pctlpre=pa pb ; run;; run; proc print data=sumdata; title 'bootstrap'; pctlpts= run;