好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

统计软件SAS简介及程序示例PPT精选文档.ppt

84页
  • 卖家[上传人]:新**
  • 文档编号:580612244
  • 上传时间:2024-08-29
  • 文档格式:PPT
  • 文档大小:230.50KB
  • / 84 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 统计软件SAS简介及程序范例1. SAS简介简介2. 《《试验统计方法》教材例题的试验统计方法》教材例题的SAS程程序及运行结果序及运行结果1 1. SAS简介 SAS (Statistical Analysis System,,统统计计分分析析系系统统)是是当当今今国国际际上上著著名名的的数数据据分分析析软软件件系系统统,其其基基本本部部分分是是SAS/BASE软软件件20世世纪纪60年年代代末末期期,,由由美美国国北北卡卡罗罗纳纳州州州州立立大大学学(North Carolina State University)的的A. J. Barr和和J. H. Goodnight两两位位教教授授开开始始开开发发,,1975年年创创建建了了美美国国SAS研研究究所所(SAS Institute Inc.)之之后后,,推推出出的的SAS系系统统,,始始终终以以领领先先的的技技术术和和可可靠靠的的支支持持著著称称于于世世,,通通过过不不断断发发展展和完善,目前已成为大型集成应用软件系统和完善,目前已成为大型集成应用软件系统2 SAS系统具有统计分析方法丰富、信系统具有统计分析方法丰富、信息储存简单、语言编程能力强、能对数据息储存简单、语言编程能力强、能对数据连续处理、使用简单等特点。

      连续处理、使用简单等特点SAS是一个是一个出色的统计分析系统,它汇集了大量的统出色的统计分析系统,它汇集了大量的统计分析方法,从简单的描述统计到复杂的计分析方法,从简单的描述统计到复杂的多变量分析,编制了大量的使用简便的统多变量分析,编制了大量的使用简便的统计分析过程计分析过程3 SAS系统运行的几个重要前提条件 ((一一))SAS系系统统运运行行时时要要同同时时打打开开的的文文件件较较多多,,因因此此在在微微型型计计算算机机的的系系统统配配置置文文件件CONFIG.SYS中应指定中应指定FILES=50或以上;或以上; ((二二))SAS系系统统软软件件有有时时间间租租期期限限制制,,因因此此只只有有机机器器时时间间((DATE))在在软软件件有有效效期期内内才才能能运运行行时时间间租租期期取取决决于于SAS出出售售版版本本日日期期,,即即所所谓谓的的SAS诞生日(诞生日(BIRTHDAY) ((三)三)SAS系统应全部安装到硬盘的系统应全部安装到硬盘的SAS子目子目录下,硬盘应至少有录下,硬盘应至少有10M空间 4 SAS for Windows的启动与退出 (一)启动(一)启动 SAS for Windows的启动,按的启动,按如下步骤进行。

      开机后,直接用鼠标双击桌如下步骤进行开机后,直接用鼠标双击桌面上面上SAS系统的快捷键图标,自动显示系统的快捷键图标,自动显示主画主画面面,即可进入,即可进入SAS系统5 (二二)退出退出 当用完当用完SAS for Windows,,需需要退出时,可以单击【要退出时,可以单击【File】,】,选择【选择【Exit】,】,或者,单击或者,单击×(关闭关闭)按钮,立即按钮,立即显示显示 如果确认需要退出如果确认需要退出SAS for Windows,,单击确定按钮;如果需要继续使用单击确定按钮;如果需要继续使用SAS for Windows,,单击取消按钮单击取消按钮 6 2. 《试验统计方法》教材例题的SAS程序及运行结果•t测验测验•方差分析方差分析•直线回归分析直线回归分析•协方差分析协方差分析7 t检验•样本平均数与总体平均数的差异显著性检验样本平均数与总体平均数的差异显著性检验 •配对试验资料的配对试验资料的t t检验检验 •非配对试验资料的非配对试验资料的t t检验检验8 样本平均数与总体平均数的差异显著性检验样本平均数与总体平均数的差异显著性检验( (例例4.3)4.3)data testt1;input x@@;differ=x-27.5;cards;32.5 28.6 28.4 24.7 29.1 27.2 29.8 33.3 29.7;proc means n mean stderr t prt;run;9 运行结果 The MEANS ProcedureVariable N Mean Std Error t Value Pr > |t| x 9 29.2555556 0.8623468 33.93 <.0001 differ 9 1.7555556 0.8623468 2.04 0.076210 配对试验资料的配对试验资料的t t检验(例检验(例4.74.7)) data testt2;input treat x1 x2@@;differ=x1-x2;cards;1 2722.2 951.4 2 2866.7 1417.0 3 2675.9 1275.34 2169.2 2228.5 5 2253.9 2462.6 6 2415.1 2715.4;proc means mean stderr t prt;var differ;run;11 运行结果 The MEANS ProcedureAnalysis Variable : differ Mean Std Error t Value Pr > |t| 675.4666667 391.5253952 1.73 0.145112 非配对试验资料的非配对试验资料的t t检验检验( (例例4.54.5) )data testt3;input variety x@@;cards;1 18.68 1 20.67 1 18.42 1 18.00 1 17.44 1 15.952 18.68 2 23.22 2 21.42 2 19.00 2 18.92;proc ttest;class variety;var x;run;13 运行结果The TTEST ProcedureT-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 9 -1.92 0.0868 x Satterthwaite Unequal 7.51 -1.87 0.1001 Equality of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 4 5 1.66 0.588014 方差分析方差分析•单因素完全随机化试验重复数相等资料单因素完全随机化试验重复数相等资料•单因素完全随机化试验重复数不等资料单因素完全随机化试验重复数不等资料•两因素交叉分组试验单独观测值资料两因素交叉分组试验单独观测值资料•两因素交叉分组试验有重复观测值资料两因素交叉分组试验有重复观测值资料•次级样本含量相等的二因素系统分组资料次级样本含量相等的二因素系统分组资料•单因素随机区组设计试验资料单因素随机区组设计试验资料 •拉丁方设计试验结果拉丁方设计试验结果 •两因素随机区组设计试验资料两因素随机区组设计试验资料 •两因素裂区设计试验资料两因素裂区设计试验资料 15 单因素完全随机化试验重复数相等资料单因素完全随机化试验重复数相等资料的方差分析(教材【例的方差分析(教材【例5.3】)】) data anova1;input variety x@@;cards;1 12 1 10 1 14 1 16 1 12 1 182 8 2 10 2 12 2 14 2 12 2 163 14 3 16 3 13 3 16 3 10 3 154 16 4 18 4 20 4 16 4 14 4 16;proc anova;class variety;model x=variety;means variety/duncan;run;16 运行结果运行结果 The ANOVA Procedure Class Level Information Class Levels Values variety 4 1 2 3 4 Number of observations 2417 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr > F Model 3 67.1666667 22.3888889 3.43 0.0369 Error 20 130.6666667 6.5333333 Corrected Total 23 197.8333333 R-Square Coeff Var Root MSE x Mean 0.339511 18.14939 2.556039 14.08333Source DF Anova SS Mean Square F Value Pr > Fvariety 3 67.16666667 22.38888889 3.43 0.036918 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 20 Error Mean Square 6.533333 Number of Means 2 3 4 Critical Range 3.078 3.231 3.328 19 Means with the same letter are not significantly different. Duncan Grouping Mean N variety A 16.667 6 4 A B A 14.000 6 3 B A B A 13.667 6 1 B B 12.000 6 220 单因素完全随机化试验重复数不等资料单因素完全随机化试验重复数不等资料的方差分析(教材【例的方差分析(教材【例5.4】)】) data anova2;input variety x@@;cards;1 21.5 1 19.5 1 20.0 1 22.0 1 18.0 1 20.02 16.0 2 18.5 2 17.0 2 15.5 2 20.0 2 16.03 19.0 3 17.5 3 20.0 3 18.0 3 17.04 21.0 4 18.5 4 19.0 4 20.05 15.5 5 18.0 5 17.0 5 16.0;proc glm;class variety;model x=variety;means variety/duncan;run;21 运行结果运行结果 The GLM Procedure Class Level Information Class Levels Values variety 5 1 2 3 4 5 Number of observations 2522 The GLM ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 4 46.49833333 11.62458333 5.99 0.0025Error 20 38.84166667 1.94208333Corrected Total 24 85.34000000 R-Square Coeff Var Root MSE x Mean 0.544860 7.565616 1.393587 18.42000 Source DF Type I SS Mean Square F Value Pr > F variety 4 46.49833333 11.62458333 5.99 0.0025 Source DF Type III SS Mean Square F Value Pr > Fvariety 4 46.49833333 11.62458333 5.99 0.002523 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 20 Error Mean Square 1.942083 Harmonic Mean of Cell Sizes 4.83871 NOTE: Cell sizes are not equal. Number of Means 2 3 4 5 Critical Range 1.869 1.962 2.021 2.06224 Means with the same letter are not significantly different. Duncan Grouping Mean N variety A 20.1667 6 1 A A 19.6250 4 4 A B A 18.3000 5 3 B B 17.1667 6 2 B B 16.6250 4 525 两因素交叉分组试验单独观测值资料的方差分析(教材【例5.5】) data anova3;input field method x@@;cards;1 1 71 1 2 73 1 3 77 2 1 90 2 2 90 2 3 923 1 59 3 2 70 3 3 80 4 1 75 4 2 80 4 3 825 1 65 5 2 60 5 3 67 6 1 82 6 2 86 6 3 85;proc anova;class field method;model x=field method;means field method/duncan;run;26 运行结果运行结果 The ANOVA Procedure Class Level Information Class Levels Values field 6 1 2 3 4 5 6 method 3 1 2 3 Number of observations 1827 The ANOVA ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 7 1576.555556 225.222222 13.97 0.0002Error 10 161.222222 16.122222Corrected Total 17 1737.777778 R-Square Coeff Var Root MSE x Mean 0.907225 5.222144 4.015249 76.88889Source DF Anova SS Mean Square F Value Pr > Ffield 5 1435.111111 287.022222 17.80 0.0001 method 2 141.444444 70.722222 4.39 0.042928 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 10 Error Mean Square 16.12222 Number of Means 2 3 4 5 6 Critical Range 7.305 7.633 7.827 7.951 8.03329 Means with the same letter are not significantly different. Duncan Grouping Mean N field A 90.667 3 2 A B A 84.333 3 6 B B C 79.000 3 4 C D C 73.667 3 1 D D E 69.667 3 3 E E 64.000 3 530 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 10 Error Mean Square 16.12222 Number of Means 2 3 Critical Range 5.165 5.39831 Means with the same letter are not significantly different. Duncan Grouping Mean N method A 80.500 6 3 A B A 76.500 6 2 B B 73.667 6 132 两因素交叉分组试验有重复观测值资料的方差分析(教材【例5.6】) data anova4;input density fert x@@;cards;1 1 27 1 2 26 1 3 31 1 4 30 1 5 25 1 1 29 1 2 25 1 3 30 1 4 30 1 5 251 1 26 1 2 24 1 3 30 1 4 31 1 5 26 1 1 26 1 2 29 1 3 31 1 4 30 1 5 242 1 30 2 2 28 2 3 31 2 4 32 2 5 28 2 1 30 2 2 27 2 3 31 2 4 34 2 5 292 1 28 2 2 26 2 3 30 2 4 33 2 5 28 2 1 29 2 2 25 2 3 32 2 4 32 2 5 273 1 33 3 2 33 3 3 35 3 4 35 3 5 30 3 1 33 3 2 34 3 3 33 3 4 34 3 5 293 1 34 3 2 34 3 3 37 3 4 33 3 5 31 3 1 32 3 2 35 3 3 35 3 4 35 3 5 30;proc anova;class density fert;model x=density fert density*fert;means density fert/duncan;means density*fert/lsd;run;33 运行结果运行结果 The ANOVA Procedure Class Level Information Class Levels Values density 3 1 2 3 fert 5 1 2 3 4 5 Number of observations 6034 The ANOVA ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 14 573.3333333 40.9523810 33.51 <.0001Error 45 55.0000000 1.2222222Corrected Total 59 628.3333333 R-Square Coeff Var Root MSE x Mean 0.912467 3.664779 1.105542 30.16667Source DF Anova SS Mean Square F Value Pr > Fdensity 2 315.8333333 157.9166667 129.20 <.0001fert 4 207.1666667 51.7916667 42.38 <.0001density*fert 8 50.3333333 6.2916667 5.15 0.000135 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 45 Error Mean Square 1.222222 Number of Means 2 3 Critical Range .7041 .740536 Means with the same letter are not significantly different. Duncan Grouping Mean N density A 33.2500 20 3 B 29.5000 20 2 C 27.7500 20 137 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 45 Error Mean Square 1.222222 Number of Means 2 3 4 5 Critical Range 0.909 0.956 0.987 1.00938 Means with the same letter are not significantly different. Duncan Grouping Mean N fert A 32.4167 12 4 A A 32.1667 12 3 B 29.7500 12 1 C 28.8333 12 239 The ANOVA Procedure Level of Level of --------------x-------------- density fert N Mean Std Dev 1 1 4 27.0000000 1.41421356 1 2 4 26.0000000 2.16024690 1 3 4 30.5000000 0.57735027 1 4 4 30.2500000 0.50000000 1 5 4 25.0000000 0.81649658 2 1 4 29.2500000 0.95742711 2 2 4 26.5000000 1.29099445 2 3 4 31.0000000 0.81649658 2 4 4 32.7500000 0.95742711 2 5 4 28.0000000 0.81649658 3 1 4 33.0000000 0.81649658 3 2 4 34.0000000 0.81649658 3 3 4 35.0000000 1.63299316 3 4 4 34.2500000 0.95742711 3 5 4 30.0000000 0.8164965840 次级样本含量相等的二因素系统分组资料次级样本含量相等的二因素系统分组资料的方差分析【例的方差分析【例5.7】】 data anova5;input plant leaf x@@;cards;1 1 12.1 1 1 12.1 1 2 12.8 1 2 12.82 1 14.4 2 1 14.4 2 2 14.7 2 2 14.53 1 23.1 3 1 23.4 3 2 28.1 3 2 28.8;proc anova;class plant leaf;model x=plant leaf(plant);means plant/duncan;run;41 运行结果运行结果 The ANOVA Procedure Class Level Information Class Levels Values plant 3 1 2 3 leaf 2 1 2 Number of observations 1242 The ANOVA ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 5 444.3500000 88.8700000 1720.06 <.0001Error 6 0.3100000 0.0516667Corrected Total 11 444.6600000 R-Square Coeff Var Root MSE x Mean 0.999303 1.291494 0.227303 17.60000Source DF Anova SS Mean Square F Value Pr > Fplant 2 416.7800000 208.3900000 4033.35 <.0001leaf(plant) 3 27.5700000 9.1900000 177.87 <.000143 The ANOVA Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 6 Error Mean Square 0.051667 Number of Means 2 3 Critical Range .3933 .407644 Means with the same letter are not significantly different. Duncan Grouping Mean N plant A 25.8500 4 3 B 14.5000 4 2 C 12.4500 4 145 单因素随机区组设计试验资料的分析(教材【例10.1】) data anova6;input variety$ block x@@;cards;A 1 15.3 B 1 18.0 C 1 16.6 D 1 16.4 E 1 13.7 F 1 17.0D 2 17.3 F 2 17.6 E 2 13.6 C 2 17.8 A 2 14.9 B 2 17.6C 3 17.6 A 3 16.2 F 3 18.2 B 3 18.6 D 3 17.3 E 3 13.9B 4 18.3 D 4 17.8 A 4 16.2 E 4 14.0 F 4 17.5 C 4 17.8;proc glm;class variety block;model x=variety block;means variety/duncan;run;46 运行结果运行结果The GLM Procedure Class Level Information Class Levels Values variety 6 A B C D E F block 4 1 2 3 4 Number of observations 2447 The GLM ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 8 55.05833333 6.88229167 51.75 <.0001Error 15 1.99500000 0.13300000Corrected Total 23 57.05333333 R-Square Coeff Var Root MSE x Mean 0.965033 2.192535 0.364692 16.63333Source DF Type I SS Mean Square F Value Pr > Fvariety 5 52.37833333 10.47566667 78.76 <.0001block 3 2.68000000 0.89333333 6.72 0.004348 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 0.133Number of Means 2 3 4 5 6Critical range .5496 .5762 .5927 .6039 .612049 Means with the same letter are not significantly different. Duncan Grouping Mean N variety A 18.1250 4 B B 17.5750 4 F B B 17.4500 4 C B B 17.2000 4 D C 15.6500 4 A D 13.8000 4 E50 拉丁方设计试验结果的分析(教材【例10.3】) data anova7;input nd$ row col x@@;cards;C 1 1 10.1 A 1 2 7.9 B 1 3 9.8 E 1 4 7.1 D 1 5 9.6A 2 1 7.0 D 2 2 10.0 E 2 3 7.0 C 2 4 9.7 B 2 5 9.1E 3 1 7.6 C 3 2 9.7 D 3 3 10.0 B 3 4 9.3 A 3 5 6.8D 4 1 10.5 B 4 2 9.6 C 4 3 9.8 A 4 4 6.6 E 4 5 7.9B 5 1 8.9 E 5 2 8.9 A 5 3 8.6 D 5 4 10.6 C 5 5 10.1;proc glm;class nd row col;model x=nd row col;means nd/duncan;run;51 运行结果运行结果 The GLM Procedure Class Level Information Class Levels Values nd 5 A B C D E row 5 1 2 3 4 5 col 5 1 2 3 4 5 Number of observations 2552 The GLM ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 12 35.50320000 2.95860000 10.88 0.0001Error 12 3.26320000 0.27193333Corrected Total 24 38.76640000 R-Square Coeff Var Root MSE x Mean 0.915824 5.867150 0.521472 8.888000Source DF Type I SS Mean Square F Value Pr > Fnd 4 32.20640000 8.05160000 29.61 <.0001row 4 2.17040000 0.54260000 2.00 0.1594col 4 1.12640000 0.28160000 1.04 0.428653 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 0.271933 Number of Means 2 3 4 5 Critical Range .7186 .7522 .7725 .786054 Means with the same letter are not significantly different. Duncan Grouping Mean N nd A 10.1400 5 D A B A 9.8800 5 C B B 9.3400 5 B C 7.7000 5 E C C 7.3800 5 A55 两因素随机区组设计试验资料两因素随机区组设计试验资料的方差分析(【例的方差分析(【例10.5】)】) data anova7;input a b block x@@;cards;3 2 1 10.0 1 2 1 11.0 2 1 1 19.0 4 1 1 17.0 2 2 1 20.0 1 1 1 12.0 3 1 1 19.0 4 2 1 11.02 2 2 19.0 1 1 2 13.0 4 1 2 16.0 1 2 2 10.0 3 2 2 8.0 2 1 2 16.0 4 2 2 9.0 3 1 2 18.04 1 3 15.0 3 2 3 7.0 2 1 3 12.0 3 1 3 16.0 1 1 3 13.0 1 2 3 13.0 2 2 3 17.0 4 2 3 8.0;proc glm;class a b block;model x=a b block a*b;means a b a*b/duncan;run;56 运行结果运行结果The GLM Procedure Class Level Information Class Levels Values a 4 1 2 3 4 b 2 1 2 block 3 1 2 3 Number of observations 2457 The GLM ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 9 332.6250000 36.9583333 17.06 <.0001Error 14 30.3333333 2.1666667Corrected Total 23 362.9583333 R-Square Coeff Var Root MSE x Mean 0.916428 10.73770 1.471960 13.70833Source DF Type I SS Mean Square F Value Pr > Fa 3 98.7916667 32.9305556 15.20 0.0001b 1 77.0416667 77.0416667 35.56 <.0001block 2 20.3333333 10.1666667 4.69 0.0276a*b 3 136.4583333 45.4861111 20.99 <.000158 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 14 Error Mean Square 2.166667 Number of Means 2 3 4 Critical Range 1.823 1.910 1.96459 Means with the same letter are not significantly different. Duncan Grouping Mean N a A 17.1667 6 2 B 13.0000 6 3 B B 12.6667 6 4 B B 12.0000 6 160 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 14 Error Mean Square 2.166667 Number of Means 2 Critical Range 1.28961 Means with the same letter are not significantly different. Duncan Grouping Mean N b A 15.5000 12 1 B 11.9167 12 262 The GLM Procedure Level of Level of --------------x-------------- a b N Mean Std Dev 1 1 3 12.6666667 0.57735027 1 2 3 11.3333333 1.52752523 2 1 3 15.6666667 3.51188458 2 2 3 18.6666667 1.52752523 3 1 3 17.6666667 1.52752523 3 2 3 8.3333333 1.52752523 4 1 3 16.0000000 1.00000000 4 2 3 9.3333333 1.5275252363 两因素裂区设计试验资料方差分析(教材【例10.6】) data anova8;input a b block x@@;cards;1 1 1 39.8 1 1 2 38.5 1 1 3 39.1 1 2 1 43.3 1 2 2 43.5 1 2 3 46.51 3 1 55.9 1 3 2 69.7 1 3 3 63.8 1 4 1 52.6 1 4 2 57.5 1 4 3 57.72 1 1 27.5 2 1 2 27.1 2 1 3 26.8 2 2 1 44.8 2 2 2 48.8 2 2 3 47.62 3 1 48.7 2 3 2 44.5 2 3 3 48.6 2 4 1 41.7 2 4 2 37.2 2 4 3 36.53 1 1 26.5 3 1 2 25.8 3 1 3 26.3 3 2 1 35.4 3 2 2 34.5 3 2 3 36.33 3 1 42.0 3 3 2 44.3 3 3 3 43.6 3 4 1 39.1 3 4 2 39.6 3 4 3 44.3;proc glm;class a b block;model x=block a a*block b a*b;means a b a*b/duncan;run;64 运行结果运行结果 The GLM Procedure Class Level Information Class Levels Values a 3 1 2 3 b 4 1 2 3 4 block 3 1 2 3 Number of observations 3665 The GLM ProcedureDependent Variable: x Sum ofSource DF Squares Mean Square F Value Pr > FModel 17 3765.737222 221.513954 33.39 <.0001Error 18 119.415000 6.634167Corrected Total 35 3885.152222 R-Square Coeff Var Root MSE x Mean 0.969264 6.078717 2.575688 42.37222Source DF Type I SS Mean Square F Value Pr > F block 2 17.137222 8.568611 1.29 0.2991a 2 1309.723889 654.861944 98.71 <.0001a*block 4 40.501111 10.125278 1.53 0.2368b 3 1975.956667 658.652222 99.28 <.0001a*b 6 422.418333 70.403056 10.61 <.000166 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 18 Error Mean Square 6.634167 Number of Means 2 3 Critical Range 2.209 2.31867 Means with the same letter are not significantly different. Duncan Grouping Mean N a A 50.658 12 1 B 39.983 12 2 C 36.475 12 368 The GLM Procedure Duncan's Multiple Range Test for x NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 18 Error Mean Square 6.634167 Number of Means 2 3 4 Critical Range 2.551 2.676 2.75669 Means with the same letter are not significantly different. Duncan Grouping Mean N b A 51.233 9 3 B 45.133 9 4 C 42.300 9 2 D 30.822 9 170 The GLM Procedure Level of Level of --------------x-------------- a b N Mean Std Dev 1 1 3 39.1333333 0.65064071 1 2 3 44.4333333 1.79257729 1 3 3 63.1333333 6.92411246 1 4 3 55.9333333 2.88848288 2 1 3 27.1333333 0.35118846 2 2 3 47.0666667 2.05264058 2 3 3 47.2666667 2.39652526 2 4 3 38.4666667 2.82193787 3 1 3 26.2000000 0.36055513 3 2 3 35.4000000 0.90000000 3 3 3 43.3000000 1.17898261 3 4 3 41.0000000 2.8687976671 直线回归分析(教材【例7.1】) data reg1;input x y@@;cards;35.5 12 34.1 16 31.7 9 40.3 2 36.8 7 40.2 3 31.7 13 39.2 9 44.2 -1;proc reg corr;model y=x;run;72 运行结果运行结果 The REG Procedure Correlation Variable x y x 1.0000 -0.8371 y -0.8371 1.000073 The REG Procedure Model: MODEL1 Dependent Variable: y Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > FModel 1 174.88878 174.88878 16.40 0.0049Error 7 74.66678 10.66668Corrected Total 8 249.55556 Root MSE 3.26599 R-Square 0.7008 Dependent Mean 7.77778 Adj R-Sq 0.6581 Coeff Var 41.9912874 Parameter Estimates Parameter StandardVariable DF Estimate Error t Value Pr > |t| Intercept 1 48.54932 10.12779 4.79 0.0020 x 1 -1.09962 0.27157 -4.05 0.004975 协方差分析 (教材【例9.3】) data anaocov1;input treat x y@@;cards;1 36 89 1 30 80 1 26 74 1 23 80 1 26 851 30 68 1 20 73 1 19 68 1 20 80 1 16 582 28 64 2 27 81 2 27 73 2 24 67 2 25 772 23 67 2 20 64 2 18 65 2 17 59 2 20 573 28 55 3 33 62 3 26 58 3 22 58 3 23 663 20 55 3 22 60 3 23 71 3 18 55 3 17 484 32 52 4 23 58 4 27 64 4 23 62 4 27 544 28 54 4 20 55 4 24 44 4 19 51 4 17 51;proc glm;class treat;model y=x treat/solution;means treat/duncan;lsmeans treat/stderr pdiff tdiff;run;76 运行结果运行结果The GLM Procedure Class Level Information Class Levels Values treat 4 1 2 3 4 Number of observations 4077 The GLM ProcedureDependent Variable: y Sum ofSource DF Squares Mean Square F Value Pr > FModel 4 3086.892991 771.723248 18.31 <.0001Error 35 1475.007009 42.143057Corrected Total 39 4561.900000 R-Square Coeff Var Root MSE y Mean 0.676668 10.13547 6.491768 64.0500078 Source DF Type I SS Mean Square F Value Pr > F x 1 579.115634 579.115634 13.74 0.0007treat 3 2507.777357 835.925786 19.84 <.0001Source DF Type III SS Mean Square F Value Pr > Fx 1 475.992991 475.992991 11.29 0.0019treat 3 2507.777357 835.925786 19.84 <.000179 Standard Parameter Estimate Error t Value Pr > |t| Intercept 36.83792240 B 5.64210743 6.53 <.0001 x 0.73591990 0.21897437 3.36 0.0019treat 1 20.55844806 B 2.90617849 7.07 <.0001treat 2 13.70951189 B 2.91318223 4.71 <.0001treat 3 4.88873592 B 2.90848747 1.68 0.1017treat 4 0.00000000 B . . .NOTE: The X'X matrix has been found to be singular, and a generalized inverse was used to solve the normal equations. Terms whose estimates are followed by the letter 'B' are not uniquely estimable.80 Duncan's Multiple Range Test for y NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 35 Error Mean Square 42.14306 Number of Means 2 3 4 Critical Range 5.894 6.196 6.39281 Means with the same letter are not significantly different. Duncan Grouping Mean N treat A 75.500 10 1 B 67.400 10 2 C 58.800 10 3 C C 54.500 10 482 The GLM Procedure Least Squares Means Standard LSMEAN treat y LSMEAN Error Pr > |t| Number 1 74.8192741 2.0628458 <.0001 1 2 67.9703379 2.0598800 <.0001 2 3 59.1495620 2.0555107 <.0001 3 4 54.2608260 2.0541106 <.0001 483 Least Squares Means for Effect treat t for H0: LSMean(i)=LSMean(j) / Pr > |t| Dependent Variable: y i/j 1 2 3 4 1 2.339936 5.367538 7.074049 0.0251 <.0001 <.0001 2 -2.33994 3.037509 4.706026 0.0251 0.0045 <.0001 3 -5.36754 -3.03751 1.680852 <.0001 0.0045 0.1017 4 -7.07405 -4.70603 -1.68085 <.0001 <.0001 0.1017NOTE: To ensure overall protection level, only probabilities associated with pre-planned comparisons should be used.84 。

      点击阅读更多内容
      相关文档
      2026年一级消防工程师考试《消防安全综合能力》预习卷.docx 2025年执业药师《药学专业知识(一)》预测试卷一.docx 2026年证券从业资格考试《证券市场基本法律法规》提分卷二.docx 2025高考真题--全国II卷高考英语真题【原卷+听力音频+听力原文+答案】.docx 2024年高考真题--新课标全国ⅠⅠ卷【英语】真题及答案(含听力音频).docx 2025年秋江苏开放大学农业生态工程060165形考作业123答案.docx 2026年一级造价工程师考试《建设工程造价案例分析(土建专业)》模拟卷.docx 2024年一级建造师-港口与航道工程管理与实务-2024年真题解析.docx 2026年一级建造师考试《公路工程管理与实务》破题卷.docx 2026年证券从业资格考试《金融市场基础知识》提分卷二.docx 2025年秋江开机电设备故障诊断与维修050096第1次形考作业带答案.docx 2025年高考真题---山东省高考真题地理试卷(含答案).docx 2025年高考真题--山东省生物高考真题(含答案).docx 2025年秋江苏开放⼤学建筑材料第⼀次作业答案.docx 2025年高考真题--云南高考地理真题(含答案).docx 2025高考真题--北京卷语文真题(含答案).docx 2025年秋江苏开放⼤学机电设备伺服与变频应⽤第1次形考作业答案.docx 2025年秋江苏开放⼤学机械创新设计060260过程性考核作业1.docx 2025年秋江苏开放大学 知识产权文献检索与应用060933过程性考试.docx 2025年高考云南物理真题(答案参考).docx
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.