P265 1今有某种型号的电池三批,它们分别是A、B、C三个工厂所生产的,为评比其质量,各随机抽取5只电池为样品,经试验得其寿命(h)如下:A B C4042 484538 262834323039 5040 5043试在显著性水平0.05下检验电池的平均寿命有无显著的差异,若差异是显著的,试求均差μA -μB,μA-μC和μB-μC的置信水平为95%的置信区间。
代码:data l1;do b=1to5;do a=1to3;input x@@;output;end;end;cards;40 26 39 42 28 50 48 34 40 45 32 50 38 30 43 proc anova;class a;model x=a;run;结果输出:The SAS System 19:15 Friday, April 9, 2012 5The ANOVA ProcedureClass Level InformationClass Levels Valuesa 3 1 2 3Number of observations 15 The SAS System 19:15 Friday, April 9, 2012 6The ANOVA ProcedureDependent Variable: xSum ofSource DF Squares Mean Square F Value Pr > FModel 2 615.6000000 307.8000000 17.07 0.0003Error 12 216.4000000 18.0333333Corrected Total 14 832.0000000R-Square Coeff Var Root MSE x Mean0.739904 10.88863 4.246567 39.00000Source DF Anova SS Mean Square F Value Pr > Fa 2 615.6000000 307.8000000 17.07 0.0003 结论:结论:在显著水平为0.05下0.0003<0.05,所以各个总体均值间有显著差异。
代码:data l1;p265 1 (ua-ub)input lei n;do rep= 1to n;input x@@;output;end;cards;1 540 42 48 45 382 526 28 34 32 30;proc ttest;class lei;var x;run;结果输出:The SAS System 19:15 Friday, April 9, 2012 25The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 5 37.664 42.6 47.536 2.3815 3.9749 11.4221.7776x 2 5 26.074 30 33.926 1.8946 3.1623 9.0871.4142x Diff (1-2) 7.3618 12.6 17.838 2.426 3.5917 6.8808 2.2716T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 8 5.55 0.0005x Satterthwaite Unequal 7.62 5.55 0.0006Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 4 4 1.58 0.6685代码:data l1;(p265 1 ub-uc)input lei n;do rep= 1to n;input x@@;output;end;cards;1 526 28 34 32 302 539 50 40 50 43;proc ttest;class lei;var x;run;结果输出:The SAS System 19:08 Friday, April 23, 2012 1The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 5 26.074 30 33.926 1.8946 3.1623 9.0871.4142x 2 5 37.795 44.4 51.005 3.1873 5.3198 15.2872.3791x Diff (1-2) -20.78 -14.4 -8.018 2.9558 4.3761 8.3835 2.7677T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 8 -5.20 0.0008x Satterthwaite Unequal 6.51 -5.20 0.0016Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 4 4 2.83 0.3378代码:data l1;(p265 1 ua-uc)input lei n;do rep= 1to n;input x@@;output;end;cards;1 540 42 48 45 382 539 50 40 50 43;proc ttest;class lei;var x;run;结果输出:The SAS System 19:15 Friday, April 9, 2012 28The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 5 37.664 42.6 47.536 2.3815 3.9749 11.4221.7776x 2 5 37.795 44.4 51.005 3.1873 5.3198 15.2872.3791x Diff (1-2) -8.648 -1.8 5.0485 3.1718 4.6957 8.996 2.9698T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 8 -0.61 0.5613x Satterthwaite Unequal 7.41 -0.61 0.5626Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 4 4 1.79 0.5862结论:在置信水平为95%的置信区间。
ua-uc、ua-ub、ub-uc分别为(-7.65,4.05)、(6.75,18.45)、(-20.25,-8.55).p 265 2为了寻找飞机控制面板上仪器表的最佳布置,试验了三个方案,观察领航在紧急情况的反应时间(以1/10秒记),随机地选择28名领航员,得到他们对于不同的布局方案的反应时间如下:方案Ⅰ14 13 9 15 11 13 14 11方案Ⅱ10 12 7 11 8 12 9 10 13 9 10 9方案Ⅲ11 5 9 10 6 8 8 7试在显著性水平0.05下检验各个方案的反应时间有无显著的差异,若有差异,试求μ1-μ2,μ1-μ3,μ2-μ3的置信水平为0.95的置信区间。
代码:data l1;(p 265 2)input type$ n;do i=1to n;input x@@;output;end;cards;M1 814 13 9 15 11 13 14 11M2 1210 12 7 11 8 12 9 10 13 9 10 9M3 811 5 9 10 6 8 8 7;proc anova;class type;model x = type;run;结果输出:The SAS System 19:10 Friday, April 16, 2012 1The ANOVA ProcedureClass Level InformationClass Levels Valuestype 3 M1 M2 M3Number of observations 28The SAS System 19:10 Friday, April 16, 2012 2The ANOVA ProcedureDependent Variable: xSum ofSource DF Squares Mean Square F Value Pr > FModel 2 81.4285714 40.7142857 11.31 0.0003Error 25 90.0000000 3.6000000Corrected Total 27 171.4285714R-Square Coeff Var Root MSE x Mean0.475000 18.70643 1.897367 10.14286Source DF Anova SS Mean Square F Value Pr > Ftype 2 81.42857143 40.71428571 11.31 0.0003 结论:在显著水平为0.05下0.0003<0.05,所以各个方案的反应时间有着明显的差异。
代码:data l1;(p265 2 u1-u2)input lei n;do rep= 1to n;input x@@;output;end;cards;1 814 13 9 15 11 13 14 112 1210 12 7 11 8 12 9 10 13 9 10 9;proc ttest;class lei;var x;run;结果输出:The SAS System 19:08 Friday, April 23, 2012 2The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 8 10.828 12.5 14.172 1.3223 2 4.07050.7071x 2 12 8.883 10 11.117 1.2454 1.7581 2.9850.5075x Diff (1-2) 0.7203 2.5 4.2797 1.4024 1.8559 2.7446 0.8471T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 18 2.95 0.0085x Satterthwaite Unequal 13.7 2.87 0.0125Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 7 11 1.29 0.6738结论:u1-u2,u1-u3,u2-u3的置信水平为0.95的置信区间为(0.72,4.28),(2.55,6.45),(0.22,3)代码:data l1;(p265 2 u1-u3)input lei n;do rep= 1to n;input x@@;output;end;cards;1 814 13 9 15 11 13 14 112 811 5 9 10 6 8 8 7;proc ttest;class lei;var x;run;结果输出:The SAS System 19:08 Friday, April 23, 2012 3The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 8 10.828 12.5 14.172 1.3223 2 4.07050.7071x 2 8 6.328 8 9.672 1.3223 2 4.07050.7071x Diff (1-2) 2.3552 4.5 6.6448 1.4643 2 3.15421T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 14 4.50 0.0005x Satterthwaite Unequal 14 4.50 0.0005Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 7 7 1.00 1.0000结论:代码:data l1;(p265 2 u2-u3)input lei n;do rep= 1to n;input x@@;output;end;cards;1 1210 12 7 11 8 12 9 10 13 9 10 92 811 5 9 10 6 8 8 7;proc ttest;class lei;var x;run;结果输出:The SAS System 19:08 Friday, April 23, 2012 4The TTEST ProcedureStatisticsLower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Errx 1 12 8.883 10 11.117 1.2454 1.7581 2.9850.5075x 2 8 6.328 8 9.672 1.3223 2 4.07050.7071x Diff (1-2) 0.2203 2 3.7797 1.4024 1.8559 2.7446 0.8471T-TestsVariable Method Variances DF t Value Pr > |t|x Pooled Equal 18 2.36 0.0297x Satterthwaite Unequal 13.7 2.30 0.0378Equality of VariancesVariable Method Num DF Den DF F Value Pr > Fx Folded F 7 11 1.29 0.6738结论:p265 3某防治站对4个林场的松毛虫密度进行调查,每个林场调查5块地得资料如下表:地点松毛虫密度(头/标准地)192 189 176 185 190190 201 187 196 200188 179 191 183 194187 180 188 175 182判断4个林场松毛从密度有无显著差异,取显著性水平α=0.05.代码:data l1;(p265 3)do b=1to5;do a=1to4;input x@@;output;end;end;cards;192 190 188 187 189 201 179 180 176 187 191 188185 196 183 175 190 200 194 182proc anova;class a;model x=a;run;结果输出:The SAS System 19:15 Friday, April 9, 2012 7The ANOVA ProcedureClass Level InformationClass Levels Valuesa 4 1 2 3 4Number of observations 20The SAS System 19:15 Friday, April 9, 2012 8The ANOVA ProcedureDependent Variable: xSum ofSource DF Squares Mean Square F Value Pr > FModel 3 403.3500000 134.4500000 3.77 0.0321 Error 16 571.2000000 35.7000000Corrected Total 19 974.5500000R-Square Coeff Var Root MSE x Mean0.413883 3.184091 5.974948 187.6500Source DF Anova SS Mean Square F Value Pr > Fa 3 403.3500000 134.4500000 3.77 0.0321 结论:P265 4一试验用来比较4种不同药品解除外科手术后疼痛的延长时间(h),结果如下表:药品时间长度(h)A 8 6 4 2B 6 6 4 4C 8 10 10 10 12D 4 4 2试在显著性水平α=0.05下检验各种药品对解除疼痛的延续时间有无显著差异。