sas 综合习题.docx
《sas 综合习题.docx》由会员分享,可在线阅读,更多相关《sas 综合习题.docx(39页珍藏版)》请在冰豆网上搜索。
sas综合习题
SAS综合练习题
1.今有某种型号的电池3批,他们分别是A,B,C,三个工厂所生产的,为评比其质量,各随机抽取5支电池为其样品,经实验的其寿命(小时)如下:
ABC
404226283950
484534324050
383043
试在显著性水平0.05下检验电池的平均寿命有无显著的差异,若差异是显著的,试求均值差是显著的,试求均值差ua-ub,ua-uc,及ub-uc的置信水平为95%的置信区间。
解:
输入:
dataL1;
Dotype=1to3;
Dorep=1to5;
inputx@@;
output;
end;
end;
cards;
404248453826283432303950405043
Procanova;
classtype;
modelx=type;
run;
输出:
TheSASSystem19:
13Sunday,April18,20111
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model2615.6000000307.800000017.070.0003
Error12216.400000018.0333333
CorrectedTotal14832.0000000
R-SquareCoeffVarRootMSExMean
0.73990410.888634.24656739.00000
SourceDFAnovaSSMeanSquareFValuePr>F
type2615.6000000307.800000017.070.0003
答:
因为0.0003<0.05,所以拒绝假设ABC组之间有显著性差异
2,为了寻找飞机控制板上仪器表的最佳布置位置,试验了三个方案,观察员在紧急情况的反应时间(以1/10秒计),随机地选择28名领航员,得到他们对于不同的布置方案的反应时间如下:
方案一
141391511131411
方案二
1012711812910139109
方案三
1159106887
试在显著性水平0.05下检验各个方案的反应时间有无显著差异。
若有显著差异,试求u1-u2,u1-u3,u2-u3置信水平为0.95的置信区间
输入:
DATAL2;
DOA=1TO3;
INPUTN;
DOJ=1TON;
INPUTX@@;
OUTPUT;
END;END;
CARDS;
8
141391511131411
12
1012711812910139109
8
1159106887
;
PROCGLM;
CLASSA;
MODELX=A;
RUN;
输出:
TheSASSystem19:
13Sunday,April18,20113
TheGLMProcedure
DependentVariable:
X
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model281.428571440.714285711.310.0003
Error2590.00000003.6000000
CorrectedTotal27171.4285714
TheSASSystem19:
53Monday,April19,20102
TheGLMProcedure
DependentVariable:
X
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model281.428571440.714285711.310.0003
Error2590.00000003.6000000
CorrectedTotal27171.4285714
R-SquareCoeffVarRootMSEXMean
0.47500018.706431.89736710.14286
SourceDFTypeISSMeanSquareFValuePr>F
A281.4285714340.7142857111.310.0003
SourceDFTypeIIISSMeanSquareFValuePr>FA281.4285714340.7142857111.310.0003
分析:
方差分析得F=11.31.P=0.0003,按
=0.05的水准下,各个方案的反应时间有显著差异。
3.某防治站对4个林场的松毛虫密度进行调查,每个林场调查五块地得资料如下表:
地点
松毛虫密度(头/标准地)
A1
192
189
176
185
190
A2
190
201
187
196
200
A3
188
179
191
183
194
A4
187
180
188
175
182
判断4个林场松毛虫密度有无显著差异,取显著性水平α=0.05.
输入:
dataa;
dotype=1to4;
dorep=1to5;
inputx@@;output;
end;end;cards;
192190188187
189201179180
176187191188
185196183175
190200194182
procanova;
classtype;
modelx=type;
run;
运行结果:
TheSASSystem19:
14Sunday,April18,20116
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model364.550000021.51666670.380.7699
Error16910.000000056.8750000
CorrectedTotal19974.5500000
R-SquareCoeffVarRootMSExMean
0.0662364.0189467.541552187.6500
SourceDFAnovaSSMeanSquareFValuePr>F
type364.5500000021.516666670.380.7699
答:
在
=0.05的显著水平下,0.7699>0.05,所以4个林场松毛虫密度没有显著差异
4,一实验用来比较4种不同药品解除外科手术后疼痛的延续时间(H),结果如下表:
药品时间长度
A
8
6
4
2
B
6
6
4
4
C
8
10
10
10
12
D
4
4
2
试在显著性水平a=0.05下检验各种药品对疼痛的延续时间有无显著差异。
输入:
DATAL6;
DOA=1TO4;
INPUTN;
DOJ=1TON;
INPUTX@@;
OUTPUT;
END;END;
CARDS;
4
8642
4
6644
5
81010101012
3
442
;
PROCGLM;
CLASSA;
MODELX=A;
RUN;
输出:
TheSASSystem19:
13Sunday,April18,20115
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model3108.333333336.111111112.500.0005
Error1234.66666672.8888889
CorrectedTotal15143.0000000
R-SquareCoeffVarRootMSExMean
0.75757627.194771.6996736.250000
SourceDFAnovaSSMeanSquareFValuePr>F
type3108.333333336.111111112.500.0005
分析:
因为0.0005<0.05,所以拒绝原假设,证明各种药品对解除疼痛时间存在显著差异。
5,将抗生素注入人体会产生抗生素与血浆蛋白质结合的现象,以致减少了药效,下表列出5种常用的抗生素注入到牛的体内时,抗生素与血浆蛋白质结合的百分比,试在水平a=0.05下检验这些百分比的均值有无显著的差异。
青霉素四环素链霉素红霉素氯霉素
29.627.35.821.629.6
24.332.66.217.432.8
28.530.811.018.325.0
32.034.88.319.024.2
试在显著性水平a=0.05下检验这些百分比的均值有无显著性差异。
输入:
dataL1;
Dotype=1to5;
Dorep=1to4;
inputx@@;
output;
end;
end;
cards;
29.624.328.532.0
27.332.630.834.8
5.86.211.08.3
21.617.418.319.0
29.232.825.024.2
Procanova;
classtype;
modelx=type;
run;
输出:
TheSASSystem19:
13Sunday,April18,20116
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model41480.823000370.20575040.88<.0001
Error15135.8225009.054833
CorrectedTotal191616.645500
R-SquareCoeffVarRootMSExMean
0.91598513.120233.00912522.93500
SourceDFAnovaSSMeanSquareFValuePr>F
type41480.823000370.20575040.88<.0001
结果分析:
因为0.0001<0.05,所以拒绝原假设,认为其各百分比有显著性差异。
6.下表给出某种化工过程再三中浓度,四种温度水平下得率的数据
温度(因素B)
10℃
24℃
38℃
52℃
浓度(因素A)
2%
1410
1111
139
1012
4%
97
108
711
610
6%
511
1314
1213
1410
试在水平a=0.05下检验,在不同浓度下得率的均值有无显著差异,在不同温度下得率的均值是否有显著差异,交互作用的效应是否显著
输入:
datal5;
doa=1to3;
dob=1to4;
doi=1to2;
inputx@@;
output;end;end;end;
dropi;
cards;
141011111391012
97108711610
511131412131410
procanova;
classab;
modelx=aba*b;
run;
输出:
TheSASSystem19:
13Sunday,April18,201112
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model1182.83333337.53030301.390.2895
Error1265.00000005.4166667
CorrectedTotal23147.8333333
R-SquareCoeffVarRootMSExMean
0.56031622.342782.32737310.41667
SourceDFAnovaSSMeanSquareFValuePr>F
a244.3333333322.166666674.090.0442
b311.500000003.833333330.710.5657
a*b627.000000004.500000000.830.5684
答:
因为pra=0.0442<0.005,所以不同浓度的影响是显著的;由于prb=0.5657〉0.050,
因为pra*b=0.5684〉0.05,故温度的影响是不显著的,交互作用对均值的影响也不显著
7.为了研究金属管的防腐蚀的功能,考虑了4种不同的涂料涂层,将金属管埋没在3种不同性质的土壤中,经历了一定时间,测得金属管腐蚀的最大深度如下表所示(以mm计):
土壤类型(因素B)
涂层(因素A)
1
2
3
1.63
1.35
1.27
1.34
1.30
1.22
1.19
1.14
1.27
1.30
1.09
1.32
失去水平=0.05检验在不同涂层下腐蚀的最大深度的平均值有无显著差异,设两因素间没有交互作用效应
输入:
datal2;
doa=1to3;
dob=1to4;
inputx@@;output;
end;end;cards;
1.631.351.27
1.341.301.22
1.191.141.27
1.301.091.32
procanova;
classab;
modelx=ab;
run;
输出:
TheSASSystem19:
13Sunday,April18,20115
TheANOVAProcedure
DependentVariable:
x
Sumof
SourceDFSquaresMeanSquareFValuePr>F
Model50.149816670.029963333.530.0780
Error60.050883330.00848056
CorrectedTotal110.20070000
R-SquareCoeffVarRootMSExMean
0.7464717.1665320.0920901.285000
SourceDFAnovaSSMeanSquareFValuePr>F
a20.078050000.039025004.600.0615
b30.071766670.023922222.820.1294
答:
因为pra=0.0615>0.05,prb=0.1294,所以涂层与土壤类型的均值无显著差异
8.下表数据是退火温度x对黄铜延性Y效应的实验结果,Y是以延长度计算的
x
300400500600700800
y
405055606770
画出散点图并求Y对于x的先行回归方程
输入:
dataL8;
inputxy@@;
cards;
300404005050055600607006780070
procplot;
ploty*x="A";
run;
procreg;
modely=x;
run;
输出:
TheSASSystem19:
13Sunday,April18,20117
TheREGProcedure
Model:
MODEL1
DependentVariable:
y
AnalysisofVariance
SumofMean
SourceDFSquaresSquareFValuePr>F
Model1606.22857606.22857176.080.0002
Error413.771433.44286
CorrectedTotal5620.00000
RootMSE1.85549R-Square0.9778
DependentMean57.00000AdjR-Sq0.9722
CoeffVar3.25525
ParameterEstimates
ParameterStandard
VariableDFEstimateErrortValuePr>|t|
Intercept124.628572.554419.640.0006
x10.058860.0044413.270.0002
Plotofy*x.Symbolusedis'A'.
y‚
‚
70ˆA
‚
‚
‚
A
‚
‚
65ˆ
‚
‚
‚
‚
‚
‚
60ˆA
‚
‚
‚
‚
‚
‚
55ˆA
‚
‚
‚
‚
‚
‚
50ˆA
‚
‚
‚
‚
‚
‚
45ˆ
‚
‚
‚
‚
‚
‚
40ˆA
‚
Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒ
300400500600700800
答:
解出所需方程为y=24.62857+0.05886x
9.在钢线炭含量对于电阻的效应的研究中,得到以下的数据:
碳含量
0.100.300.400.550.700.800.95
电阻Y
1518192122.623.826
⑴画出散点图⑵求线性回归方程y=a+bx
输入:
dataL1;
inputxy@@;
cards;
0.1150.3180.4190.5.0.55210.722.60.823.80.9526
procplot;
ploty*x;
run;
proccorr;
varxy;
procreg;
modely=x/cliclmclb;
run;
输出:
TheSASSystem19:
13Sunday,April18,201112
Plotofy*x.Legend:
A=1obs,B=2obs,etc.
y‚
26ˆA
‚
‚
‚
25ˆ
‚
‚
‚
24ˆ
‚A
‚
‚
23ˆ
‚
‚A
‚
22ˆ
‚
‚
‚
21ˆA
‚
‚
‚
20ˆ
‚
‚
‚
19ˆA
‚
‚
‚
18ˆA
‚
‚
‚
17ˆ
‚
‚
‚
16ˆ
‚
‚
‚
15ˆA
Šƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒ
0.100.150.200.250.300.350.400.450.500.550.600.650.700.750.800.850.900.95
NOTE:
1obshadmissingvalues.
TheSASSystem19:
13Sunday,April18,201120
TheCORRProcedure
2Variables:
xy
SimpleStatistics
VariableNMeanStdDevSumMinimumMaximum
x80.537500.276134.300000.100000.95000
y720.771433.74242145.4000015.0000026.00000
PearsonCorrelationCoefficients
Prob>|r|underH0:
Rho=0
NumberofObservations
xy
x1.000000.99871
<.0001
87
y0.998711.00000
<.0001
77
TheREGProcedure
Model:
MODEL1
DependentVariable:
y
AnalysisofVariance
SumofMean
SourceDFSquaresSquareFValuePr>F
Model183.8183183.818311940.48<.0001
Error50.215970.04319
CorrectedTotal684.03429
RootMSE0.20783R-Square0.9974
DependentMean20.77143AdjR-Sq0.9969
CoeffVar1.00057
ParameterEstimates
ParameterStandard
VariableDFEsti