资源描述:
《数学建模第五次作业》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1.区间估计解:R程序:X<-c(1067,919,1196,785,1126,936,918,1156,920,948);n<-length(X);xb<-mean(X);S2<-var(X);S<-sqrt(S2);T=(xb-1000)/(S/sqrt(n));结果:meandfab1997.19902.99651091.203p-value=0.5270268由此可知:置信区间为902.996到1096.203,该批灯泡能使用1000小时以上的概率为52.70268%。2.假设检测I解:假设H0<=225,H1>225此问题是单边检验输入
2、数据,调用函数t.test()R程序:X<-c(220,188,162,230,145,160,238,188,247,113,126,245,164,231,256,183,190,158,224,175)t.test(X,alternative="greater",mu=225)结果:data:Xt=-3.4783,df=19,p-value=0.9987alternativehypothesis:truemeanisgreaterthan22595percentconfidenceinterval:175.8194Infsampleesti
3、mates:meanofx192.15由此可知:P值为0.9987,不能拒绝原假设,接受H0,即认为油漆工人的血小板计数与正常成年男子有差异,油漆作业对人体血小板计数有影响。3.假设检测II解:(1)两总体方差相同模型选择t检验法R程序:X<-c(113,120,138,120,100,118,138,123)Y<-c(138,116,125,136,110,132,130,110)t.test(X,Y,alternative="less",var.equal=TRUE)t.test(X,Y,alternative="less")结果:TwoSa
4、mplet-testdata:XandYt=-0.566,df=14,p-value=0.2902alternativehypothesis:truedifferenceinmeansislessthan095percentconfidenceinterval:-Inf7.12812sampleestimates:meanofxmeanofy121.250124.625(2)两总体方差不同模型R程序:X<-c(113,120,138,120,100,118,138,123)Y<-c(138,116,125,136,110,132,130,110)
5、var.test(X,Y)结果:Ftesttocomparetwovariancesdata:XandYF=1.2278,numdf=7,denomdf=7,p-value=0.7935alternativehypothesis:trueratioofvariancesisnotequalto195percentconfidenceinterval:0.24581036.1327511sampleestimates:ratioofvariances1.227800(3)成对数据模型R程序:X<-c(113,120,138,120,100,118,
6、138,123)Y<-c(138,116,125,136,110,132,130,110)var.test(X,Y,alternative="less",exact=F)结果:Ftesttocomparetwovariancesdata:XandYF=1.2278,numdf=7,denomdf=7,p-value=0.6033alternativehypothesis:trueratioofvariancesislessthan195percentconfidenceinterval:0.0000004.649733sampleestimate
7、s:ratioofvariances1.227800由此可知:(1)p=0.29(2)p=0.79(3)p=0.60,置信区间(1)>(2)>(3)。1.假设检测III解:由题可知所检验的问题为H0:p=p0=0.147,H1:p≠p0。调用binom.test()函数:binom.test(57,400,p=0.147)结果:data:57and400numberofsuccesses=57,numberoftrials=400,p-value=0.8876alternativehypothesis:trueprobabilityofsuc
8、cessisnotequalto0.14795percentconfidenceinterval:0.10974770.1806511s