SAS作业(1)详解
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
SAS作业(1)详解
By 乔兴龙P57 13.下表分别给出两个文学家马克吐温(Mark Twain)的8篇小品文以及斯诺特格拉斯(Snodgrass)的10篇小品文中由3个字母组成的词的比例:
马克
0.225 0.262 0.217 0.240 0.230 0.229 0.235 0.217
吐温
斯诺
0.209 0.205 0.196 0.210 0.202 0.207 0.224 0.223 0.220 0.201 特格
拉斯
设两组数据分别来自正态总体,且两个总体方差相等,两个样本相互独立。问两个作家所写的小品文中包含由3个字母组成的词的比例是否有显著的差异(取α=)?
0.05
分析:检验是否有差异,即检验u1-u2=0,方差相等且未知,因此要用t检验法,置信区间a=0.05
操作:
在program editor 中输入
Data P59Q13;
input x y @@;
card;
0.225 0.209 0.262 0.205 0.217 0.196 0.240 0.210 0.230 0.202 0.229 0.207 0.235 0.224 0.217 0.223 . 0.220 . 0.201
proc print;
run;
点击运行一次。
Solutions—analysis—analyst
File—open by sas name—work—p59q13—OK
Statistics—hypothesis tests—two sample t test for means
选中two variables,x—group 1,y—group 2,mean1-mean2=0,alternative选择第一个,test—confidence intervals选择interval,95.0%
OK—OK
所得结果:
Two Sample t-test for the Means of x and y 8
09:29 Wednesday, October 7, 2011
Sample Statistics
Group N Mean Std. Dev. Std. Error ----------------------------------------------------
x 8 0.231875 0.0146 0.0051 y 10 0.2097 0.0097 0.0031
Hypothesis Test
Null hypothesis: Mean 1 - Mean 2 = 0 Alternative: Mean 1 - Mean 2 ^= 0
If Variances Are t statistic Df Pr > t ----------------------------------------------------
Equal 3.878 16 0.0013 Not Equal 3.704 11.67 0.0032
95% Confidence Interval for the Difference between Two Means
Lower Limit Upper Limit ----------- ----------- 0.01 0.03
Mean1-mean2可能性=0.0013<0.05,拒绝原假设,两者存在显著性差异。
P57 14.在第13题中分别记两个总体的方差为21σ和22σ。试检验假设(取0.05α=)
2222
012112
H =H : σσσσ≠: ,
以说明在13题中我们假设22
12=σσ是合理的。
分析:方差未知,检验二者是否相等,即检验σ12/σ22=1,使用F 检验 操作:(继续13题的操作)Statistics —hypothesis tests —two sample t test for variance 选中two variables , x —group 1,y —group 2,variance1/ variance2=1,alternative 选择第一个, intervals —interval ,95.0%—OK —OK
输出结果:
Two Sample Test for Variances of x and y 9
09:29 Wednesday, October 7, 2011
Sample Statistics
Group N Mean Std. Dev. Variance --------------------------------------------------
x 8 0.231875 0.0146 0.000212 y 10 0.2097 0.0097 0.000093
Hypothesis Test
Null hypothesis: Variance 1 / Variance 2 = 1 Alternative: Variance 1 / Variance 2 ^= 1
- Degrees of Freedom -
F Numer. Denom. Pr > F ----------------------------------------------
2.27 7 9 0.2501
95% Confidence Interval of the Ratio of Two Variances
Lower Limit Upper Limit ----------- ----------- 0.5415 10.961