- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
统计建模与r软件第八章答案
【篇一:统计建模与r软件-第4~9章习题】
x-c(0.1,0.2,0.9,0.8,0.7,0.7)
n-length(x)
a1-mean(x);
m2-(n-1)/n*var(x)
a1-1/(1-a1)-2;a1
[1]0.3076923
极大似然估计
f-function(a2){sum(log(x))+n/(1+a2)}
out-uniroot(f,c(0,1));a2-out$root;a2
[1]0.211182
4.2
x-
c(rep(5,365),rep(15,245),rep(25,150),rep(35,100),rep(45,70),rep(5
5,45),rep(65,25))lamda-length(x)/sum(x);lamda
[1]0.05
4.3
取均值即可。
x-c(rep(0,17),rep(1,20),rep(2,10),rep(3,2),rep(4,1))
mean(x)
[1]1
平均为1个。
4.4
obj-function(x){f-c(-13+x[1]+((5-x[2])*x[2]-2)*x[2],-
29+x[1]+((x[2]+1)*x[2]-14)*x[2]);sum(f^2)}
x0-c(0.5,-2)
nlm(obj,x0)
$minimum
[1]48.98425
$estimate
[1]11.4127791-0.8968052
$gradient
[1]1.411401e-08-1.493206e-07
$code
[1]1
$iterations
[1]16
4.5
x-c(54,67,68,78,70,66,67,70,65,69)
t.test(x)#t.test()做单样本正态分布区间估计
onesamplet-test
data:x
t=35.947,df=9,p-value=4.938e-11
alternativehypothesis:truemeanisnotequalto0
95percentconfidenceinterval:
63.158571.6415
sampleestimates:
meanofx
67.4
平均脉搏点估计为67.4,95%区间估计为63.158571.6415。
t.test(x,alternative=less,mu=72)#t.test()做单样本正态分布单侧
区间估计
onesamplet-test
data:x
t=-2.4534,df=9,p-value=0.01828
alternativehypothesis:truemeanislessthan72
95percentconfidenceinterval:
-inf70.83705
sampleestimates:
meanofx
67.4
p值小于0.05,拒绝原假设,平均脉搏低于常人。
4.6
x-c(140,137,136,140,145,148,140,135,144,141);x
[1]140137136140145148140135144141
y-c(135,118,115,140,128,131,130,115,131,125);y
[1]135118115140128131130115131125
t.test(x,y,var.equal=true)
twosamplet-test
data:xandy
t=4.6287,df=18,p-value=0.0002087
alternativehypothesis:truedifferenceinmeansisnotequalto
0
95percentconfidenceinterval:
7.5362620.06374
sampleestimates:
meanofxmeanofy
140.6126.8
期望差的95%置信区间为7.5362620.06374。
4.7
x-c(0.
文档评论(0)