您好,欢迎访问三七文档
第七章t检验单样本t检测,用means、univariatedatatemp;inputx@@;y=x-20.7;cards;20.9920.4120.1020.0020.9122.6020.9920.4220.9022.9923.1220.89;procmeansmeanstderrtprobt;vary;run;datatemp;inputx@@;y=x-20.7;cards;20.9920.4120.1020.0020.9122.6020.9920.4220.9022.9923.1220.89;procunivariatenormal;vary;run;无原始数据的单样本t检验:datatemp;inputu0u1sn;t=(u1-u0)/(s/sqrt(n));v=n-1;p=probt(t,v);cards;7274.26.525;procprint;run;配对的t检测:有两个对比的检测有ttestmeansunivariatedatatemp;inputidab;cards;12.412.8022.903.0432.751.8842.233.4353.673.8164.494.0075.164.4485.455.4192.061.24101.641.83111.061.45120.770.92;procttest;paireda*b;run;datatemp;inputidab;y=a-b;cards;12.412.8022.903.0432.751.8842.233.4353.673.8164.494.0075.164.4485.455.4192.061.24101.641.83111.061.45120.770.92;procunivariatenormal;vary;run;正态性检测:wp,t=0.162pr=0.870.05,接受H0;datatemp;inputidab;y=a-b;cards;12.412.8022.903.0432.751.8842.233.4353.673.8164.494.0075.164.4485.455.4192.061.24101.641.83111.061.45120.770.92;procmeansmeanstderrtprobt;vary;run;datatemp;inputdsn;t=d/(s/sqrt(n));v=n-1;p=probt(t,v);cards;0.6250.788;procprint;run;独立样本t检测datatemp;inputgroupx@@;cards;11341146110411191124116111071831113112919711232702118210128521072132294procttest;classgroup;varx;run;datatemp;inputx1x2n1n2s1s2;sc=sqrt((1/n1+1/n2)*((n1-1)*s1**2+(n2-1)*s2**2)/(n1+n2-2));t=(x2-x1)/sc;v=n1+n2-2;p=probt(t,v);cards;20.9521.7920205.893.43;procprint;run;第九章直线回归和相关dataexam9_1;inputx1x2@@;cards;1.213.901.304.501.394.201.424.831.474.161.564.931.684.321.724.991.984.702.105.20;procgplot;/*拓扑图*/plotx2*x1='*';/*图*/run;proccorr;varx1x2;run;相关性相关系数为:0.68073。p为0.0303dataexm9_2;inputxy@@;cards;7945803091169024702887259214;proccorrspearman;varxy;run;直线回归dataexm9_3;inputxy@@;cards;25.59.219.57.824.09.420.58.625.09.022.08.821.59.023.59.426.59.723.59.426.59.723.58.822.08.520.08.228.09.9;procreg;modely=x/rclm;/*针对每一条的观测的输出*/run;多元线性回归datatemp;inputx1x2x3y;cards;51.373.636.42.9948.983.934.03.1142.878.331.01.9155.077.131.02.6345.381.730.02.8645.374.832.01.9151.473.736.52.9853.879.437.03.2849.072.630.12.5253.979.537.13.27;procreg;modely=x1x2x3/tolvifcollinselection=stepwiser;run;偏相关与复相关dataexm10_2;inputx1x2x3x4y;cards;72666078.5129155274.3;proccorr;varx1x2x3x4y;run;proccorrnosimple;varx1y;partialx2x3x4;run;proccorrnosimple;varx2y;partialx1x3x4;run;proccorrnosimple;varx3y;partialx2x1x4;run;proccorrnosimple;varx4y;partialx2x3x1;run;proccorrnosimple;varx1x2x3y;partialx4;run;dataexm10_2;inputx1x2x3x4y;cards;72666078.5129155274.31156820104.3113184787.675263395.9;proccorr;varx1x2x3x4y;run;proccorrnosimple;varx1y;partialx2x3x4;run;proccorrnosimple;varx2y;partialx1x3x4;run;proccorrnosimple;varx3y;partialx2x1x4;run;proccorrnosimple;varx4y;partialx2x3x1;run;proccorrnosimple;varx1x2x3y;partialx4;run;第十四章非参数检验dataexm10_2;inputx1x2x3x4y;cards;72666078.5129155274.31156820104.3113184787.675263395.9;proccorr;varx1x2x3x4y;run;proccorrnosimple;varx1y;partialx2x3x4;run;proccorrnosimple;varx2y;partialx1x3x4;run;proccorrnosimple;varx3y;partialx2x1x4;run;proccorrnosimple;varx4y;partialx2x3x1;run;proccorrnosimple;varx1x2x3y;partialx4;run;dataexm4_2;inputwt@@;devi=wt-2.15;cards;2.152.102.202.1.22.422.522.622.722.993.193.374.57;procunivariate;/单变量/vardevi;run;P0.05,小概率事件发生,拒绝H0,接受H1。配对的非参数的检验:dataexm10_2;inputx1x2x3x4y;cards;72666078.5129155274.31156820104.3113184787.675263395.9;proccorr;varx1x2x3x4y;run;proccorrnosimple;varx1y;partialx2x3x4;run;proccorrnosimple;varx2y;partialx1x3x4;run;proccorrnosimple;varx3y;partialx2x1x4;run;proccorrnosimple;varx4y;partialx2x3x1;run;proccorrnosimple;varx1x2x3y;partialx4;run;dataexm4_2;inputwt@@;devi=wt-2.15;cards;2.152.102.202.1.22.422.522.622.722.993.193.374.57;procunivariate;/单变量/vardevi;run;dataex14_4;inputx1x2;d=x1-x2;cards;395542545155434755534563225248444048455540324957;procunivariate;vard;run;两种非参数检验dataex14_6;inputgroupveci@@;cards;12.7813.2314.214.8715.1216.2117.1818.0518.5619.623.2323.524.0424.1524.2824.3424.4724.6424.7524.8224.9525.10;procnparlwaywilcoxon;classgroup;varveci;run;dataex14_9;dogroup=1to3;inputrate@@;output;end;cards;32.516.06.535.520.59.040.522.512.546.029.018.049.036.024.0;procnparlwaywilcoxon;classgroup;varrate;run;dataex14_12;dox=1to4;dog=1to2;inputf@@;output;end;end;cards;654218630231311;procnparlwaywilcoxon;calssg;varx;freqf;run;dataex14_12;dox=1to4;dog=1to4;inputf@@;output;end;end;cards;0353257595336220;procnparlwaywilcoxon;calssg;varx;freqf;run;dataex14_17;inputxy@@;cards;;7945803091169024702887259214;proccorrspearman;varxy;run;dataexm14_15;doblock=1to8;dotreat=1to4;inputrate@@;output;end;end;cards;8.49.69.811.711.612.711.812.09.49.110.49.89.88.79.912.08.38.08.68.68.69.89.610.68.99.010.611.47.88.28.510.8;procsortdata=exm14_15out=a;byblock;run;procrankdata=aout=b;varrate;byblock;ranksr;procglmdata=b;classtreatblock;modelr=treatblock;run;第十六章主成分分析dataex16_1;inputx1-x4;cards;402.0520101.55301203.013502504.51801203.5950101.51250401.01940;procprincompdata=ex16_1out=out1outstat=stat1prefix=z;varx1-x4;run;'procprintdata=out1;title'output:out1';run;procprintdata=stat1;title'output:stat1';run;
本文标题:统计分析SAS练习
链接地址:https://www.777doc.com/doc-2138576 .html