欢迎来到天天文库
浏览记录
ID:49410636
大小:526.00 KB
页数:46页
时间:2020-02-06
《浙大统计学专业回归分析课件example.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Page80例子3.3检查数据有无输错方程显著性检验结论:截距不显著修改reg模型procreg;modely=x/nointprcliclmdw;outputout=s.p80resultp=yhatr=yresidcookd=cookdh=levelstudent=stdr;plotr.*p.;plotr.*x;run;其余不变F值变大,模型更显著回归系数显著随机误差无1阶自回归结论:方差齐性假设不合理作变换z=sqrt(y)得到z的数据Obsxyiz16790.79540.888822292
2、0.44540.66332310120.56540.7483344930.79540.8888255822.70541.64317611563.64541.9078879974.73542.17486821899.50543.08221910975.34542.310841020786.85542.617251118185.84542.416611217005.21542.28254137473.25541.802781420304.43542.10476。。。。。。。结论:模型显著结论:回归系数
3、显著DW检验,残差无一阶自回归结论:从标准化残差分析,序号为26的点为异常点。从COOK距离分析,序号为26,50的点为强影响点。用t分布来检验异常点结论:序号为26的数据为异常点。对策:检查原始数据的抄录是否有误。不然,从原始数据中剔除它们。对yresid作正态性检验结论:接受0均值正态分布的假设。残差图结论:已满足回归函数线性假设、方差齐性假设预测dataexample1;inputxy;cards;0.0340.50.0439.50.05410.0741.50.09430.1420.1245
4、0.1547.50.17530.2560.06.;run;procplotdata=example1;ploty*x;run;procregdata=example1;modely=x/prcliclm;outputout=aap=phatL95=aU95=b;run;procprintdata=aa;run;从外部调入数据libnamecj'd:user';datacj.chengji;infile'd:userchengji.txt';inputname$x1-x4;y=max(x1,x
5、2,x3,x4);z=mean(ofx1-x4);run;procprint;run;libnamecj'd:user';datacj.chengji;infile'd:userchengji.txt';inputname$x1-x4;y=max(x1,x2,x3,x4);z=mean(ofx1-x4);run;procprint;run;datacj.newset;setcj.chengji(keep=z);run;procprintdata=cj.newset;run;If语句取子集li
6、bnamecj'd:user';dataa;setcj.chengji;ifx3<60;run;procprintdata=a;run;If…then(或else)语句libnamecj'd:user';dataab;setcj.chengji;ifx3<60thenoutputa;elseoutputb;run;procprintdata=a;run;procprintdata=b;run;Delete语句libnamecj'd:user';dataa;setcj.chengji;ifx3
7、>=60thendelete;run;procprintdata=a;run;retain语句dataa;inputx@@;retainsx10sx20;sx1=sx1+x;sx2=sx2+x*x;cards;254367;run;procprintdata=a;run;计算pi值dataa;retainm=0;don=1to100000;x=uniform(0);y=uniform(0);ify<1/(1+x*x)thenm=m+1;ifn>99000thenpi=4*m/n;output;en
8、d;procprint;run;9999678351999960.478190.897223.134179999778352999970.165940.562833.134179999878353999980.349250.508563.134189999978353999990.776810.652953.13415100000783531000000.571940.826963.13412
此文档下载收益归作者所有