sas综合习题.doc

上传人:jian****018 文档编号:9316666 上传时间:2020-04-04 格式:DOC 页数:30 大小:195.50KB
返回 下载 相关 举报
sas综合习题.doc_第1页
第1页 / 共30页
sas综合习题.doc_第2页
第2页 / 共30页
sas综合习题.doc_第3页
第3页 / 共30页
点击查看更多>>
资源描述
SAS综合练习题1. 今有某种型号的电池3批,他们分别是A,B,C,三个工厂所生产的,为评比其质量,各随机抽取5支电池为其样品,经实验的其寿命(小时)如下: A B C 40 42 26 28 39 50 48 45 34 32 40 5038 30 43 试在显著性水平0.05下检验电池的平均寿命有无显著的差异,若差异是显著的,试求均值差是显著的,试求均值差ua-ub,ua-uc,及ub-uc的置信水平为95%的置信区间。解:输入:data L1;Do type=1 to 3;Do rep=1 to 5;input x;output;end;end;cards;40 42 48 45 38 26 28 34 32 30 39 50 40 50 43Proc anova;class type;model x=type;run;输出: The SAS System 19:13 Sunday, April 18, 2011 1 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr F Model 2 615.6000000 307.8000000 17.07 0.0003 Error 12 216.4000000 18.0333333 Corrected Total 14 832.0000000 R-Square Coeff Var Root MSE x Mean 0.739904 10.88863 4.246567 39.00000 Source DF Anova SS Mean Square F Value Pr F type 2 615.6000000 307.8000000 17.07 0.0003 答:因为0.0003 F Model 2 81.4285714 40.7142857 11.31 0.0003 Error 25 90.0000000 3.6000000 Corrected Total 27 171.4285714The SAS System 19:53 Monday, April 19, 2010 2 The GLM ProcedureDependent Variable: X Sum of Source DF Squares Mean Square F Value Pr F Model 2 81.4285714 40.7142857 11.31 0.0003 Error 25 90.0000000 3.6000000 Corrected Total 27 171.4285714R-Square Coeff Var Root MSE X Mean 0.475000 18.70643 1.897367 10.14286 Source DF Type I SS Mean Square F Value Pr F A 2 81.42857143 40.71428571 11.31 0.0003 Source DF Type III SS Mean Square F Value Pr F A 2 81.42857143 40.71428571 11.31 0.0003分析:方差分析得F=11.31.P=0.0003,按=0.05的水准下,各个方案的反应时间有显著差异。3. 某防治站对4个林场的松毛虫密度进行调查,每个林场调查五块地得资料如下表:地点松毛虫密度(头/标准地)A1192189176185190A2190201187196200A3188179191183194A4187180188175182判断4个林场松毛虫密度有无显著差异,取显著性水平=0.05. 输入: data a;do type=1 to 4;do rep=1 to 5;input x;output;end;end;cards;192 190 188 187189 201 179 180176 187 191 188185 196 183 175190 200 194 182proc anova;class type;model x=type;run;运行结果:The SAS System 19:14 Sunday, April 18, 2011 6 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr F Model 3 64.5500000 21.5166667 0.38 0.7699 Error 16 910.0000000 56.8750000 Corrected Total 19 974.5500000 R-Square Coeff Var Root MSE x Mean 0.066236 4.018946 7.541552 187.6500 Source DF Anova SS Mean Square F Value Pr F type 3 64.55000000 21.51666667 0.38 0.7699答:在=0.05的显著水平下,0.76990.05,所以4个林场松毛虫密度没有显著差异4, 一实验用来比较4种不同药品解除外科手术后疼痛的延续时间(H),结果如下表:药品 时间长度A8642B6644C810101012D442试在显著性水平a=0.05下检验各种药品对疼痛的延续时间有无显著差异。输入:DATA L6;DO A=1TO 4;INPUT N;DO J=1TO N;INPUT X;OUTPUT;END;END;CARDS;48 6 4 2 46 6 4 4 58 10 10 10 10 1234 4 2;PROC GLM;CLASS A;MODEL X=A;RUN;输出: The SAS System 19:13 Sunday, April 18, 2011 5 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr F Model 3 108.3333333 36.1111111 12.50 0.0005 Error 12 34.6666667 2.8888889 Corrected Total 15 143.0000000 R-Square Coeff Var Root MSE x Mean 0.757576 27.19477 1.699673 6.250000 Source DF Anova SS Mean Square F Value Pr F type 3 108.3333333 36.1111111 12.50 0.0005分析:因为0.0005 F Model 4 1480.823000 370.205750 40.88 F type 4 1480.823000 370.205750 40.88 .0001结果分析:因为0.0001 F Model 11 82.8333333 7.5303030 1.39 0.2895 Error 12 65.0000000 5.4166667 Corrected Total 23 147.8333333 R-Square Coeff Var Root MSE x Mean 0.560316 22.34278 2.327373 10.41667 Source DF Anova SS Mean Square F Value Pr F a 2 44.33333333 22.16666667 4.09 0.0442 b 3 11.50000000 3.83333333 0.71 0.5657 a*b 6 27.00000000 4.50000000 0.83 0.5684 答: 因为pr a=0.0442 F Model 5 0.14981667 0.02996333 3.53 0.0780 Error 6 0.05088333 0.00848056 Corrected Total 11 0.20070000 R-Square Coeff Var Root MSE x Mean 0.746471 7.166532 0.092090 1.285000 Source DF Anova SS Mean Square F Value Pr F a 2 0.07805000 0.03902500 4.60 0.0615 b 3 0.07176667 0.02392222 2.82 0.1294 答:因为pr a=0.06150.05, pr b=0.1294,所以涂层与土壤类型的均值无显著差异8. 下表数据是退火温度x对黄铜延性Y效应的实验结果,Y是以延长度计算的 x 300 400 500 600 700 800 y 40 50 55 60 67 70画出散点图并求Y对于x的先行回归方程输入:data L8;input x y;cards;300 40 400 50 500 55 600 60 700 67 800 70proc plot;plot y*x=A;run;proc reg;model y=x;run;输出: The SAS System 19:13 Sunday, April 18, 2011 7 The REG Procedure Model: MODEL1 Dependent Variable: y Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 1 606.22857 606.22857 176.08 0.0002 Error 4 13.77143 3.44286 Corrected Total 5 620.00000 Root MSE 1.85549 R-Square 0.9778 Dependent Mean 57.00000 Adj R-Sq 0.9722 Coeff Var 3.25525 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr |t| Intercept 1 24.62857 2.55441 9.64 0.0006 x 1 0.05886 0.00444 13.27 0.0002 Plot of y*x. Symbol used is A. y 70 A A 65 60 A 55 A 50 A 45 40 A 300 400 500 600 700 800答:解出所需方程为y=24.62857+0.05886x9. 在钢线炭含量对于电阻的效应的研究中,得到以下的数据:碳含量0.10 0.30 0.40 0.55 0.70 0.80 0.95 电阻Y15 18 19 21 22.6 23.8 26画出散点图 求线性回归方程y=a+bx输入:data L1;input x y ;cards;0.1 15 0.3 18 0.4 19 0.5 . 0.55 21 0.7 22.6 0.8 23.8 0.95 26proc plot;plot y*x;run;proc corr;var x y;proc reg;model y=x/cli clm clb;run;输出: The SAS System 19:13 Sunday, April 18, 2011 12 Plot of y*x. Legend: A = 1 obs, B = 2 obs, etc. y 26 A 25 24 A 23 A 22 21 A 20 19 A 18 A 17 16 15 A 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95NOTE: 1 obs had missing values. The SAS System 19:13 Sunday, April 18, 2011 20 The CORR Procedure 2 Variables: x y Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum x 8 0.53750 0.27613 4.30000 0.10000 0.95000 y 7 20.77143 3.74242 145.40000 15.00000 26.00000 Pearson Correlation Coefficients Prob |r| under H0: Rho=0 Number of Observations x y x 1.00000 0.99871 .0001 8 7 y 0.99871 1.00000 F Model 1 83.81831 83.81831 1940.48 |t| 95% Confidence LimitsIntercept 1 13.95839 0.17347 80.47 .0001 13.51247 14.40430 x 1 12.55034 0.28491 44.05 .0001 11.81796 13.28271 19:13 Sunday, April 18, 2011 8 The REG Procedure Model: MODEL1 Dependent Variable: y Output Statistics Dep Var Predicted Std Error Obs y Value Mean Predict 95% CL Mean 95% CL Predict Residual 1 15.0000 15.2134 0.1486 14.8314 15.5955 14.5566 15.8702 -0.2134 2 18.0000 17.7235 0.1047 17.4544 17.9926 17.1253 18.3217 0.2765 3 19.0000 18.9785 0.0885 18.7511 19.2059 18.3979 19.5592 0.0215 4 . 20.2336 0.0795 20.0292 20.4379 19.6616 20.8056 . 5 21.0000 20.8611 0.0786 20.6591 21.0631 20.2899 21.4322 0.1389 6 22.6000 22.7436 0.0904 22.5112 22.9760 22.1610 23.3262 -0.1436 7 23.8000 23.9987 0.1074 23.7225 24.2748 23.3973 24.6000 -0.1987 8 26.0000 25.8812 0.1401 25.5211 26.2413 25.2369 26.5255 0.1188 Sum of Residuals 0 Sum of Squared Residuals 0.21597 Predicted Residual SS (PRESS) 0.50730答:得回归方程:y=13.95839+12.55034x; Pr0.05 故回归效果显著, b的置信水平为0.95的置信区间(11.82,13.28)x0.50处的值的置信水平为0.95 的置信区间为(20.03,20.44)x0.50处的观测值置信水平为0.95的置信区间为(19.66,20.81)10 下表列出了18个5-8岁儿童的重量(这是容易测得的)和体积(这是难以测得的)重量x17.1 10.5 13.8 15.7 11.9 10.4 15.0 16.0 17.8体积Y16.7 10.4 13.5 15.7 11.6 10.2 14.5 15.8 17.6重量x15.6 15.1 12.1 18.4 17.1 16.7 16.5 15.1 15.1体积y15.2 14.8 11.9 18.3 16.7 16.6 15.9 15.1 14.5画出散点图 求Y关于x的先行回归方程y=a+bx输入:data L3;input x y ;cards;17.1 16.7 10.5 10.4 13.8 13.5 15.7 15.7 11.9 11.6 10.4 10.2 15 14.5 16.0 15.8 17.8 17.615.8 15.2 15.1 14.8 12.1 11.9 18.4 18.3 17.1 16.7 16.7 16.6 16.5 15.9 15.1 15.1 15.1 14.5proc plot;plot y*x;run;proc reg;model y=x/cli;run;输出: The SAS System 19:13 Sunday, April 18, 2011 13
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 图纸专区 > 大学资料


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!