r语言与统计分析考试题_R语言与统计分析第五章习题答案

可复制、编制,期待你的好评与关注!

#5.1

x

y

e=sum(x*y)/sum(y) #

样本期望

d=(sum(x*x*y)/sum(y))-e^2  #

样本方差

a=(8*e+sqrt(64*e^2-4*4*(4*e^2-12*d)))/8  #

估计结果

b=(8*e-sqrt(64*e^2-4*4*(4*e^2-12*d)))/8

a

b

#5.2

x

y

e=2.718281828459

f

λ

)(e^(-50*

λ

)*

λ

^50)/(2^10*6^2*24) #

似然函数

optimize(f,c(0,2),maximum=TRUE)

#5.3

x

置信区间

t.test(x)$conf.int

chisq.var.test

options(digits=4)

result

n

v

result$var

chi2

result$chi2

p

result$p.value

if(alternative=="less")

result$p.value

else if (alternative=="two.sider")

result$p.value

result$conf.int

(n-1)*v/qchisq(alpha/2,df=n-1,lower.tail=F),

(n-1)*v/qchisq(alpha/2,df=n-1,lower.tail=T)

)

result

}

chisq.var.test(x,var(x),0.90,alternative="two.side")$conf.int  #0.90

置信区间

#5.4

x

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值