![](/img/trans.png)
[英]How can I calculate confidence interval for a mean in R not using confint
[英]How to calculate the confidence interval (using “binom.confint”) for a vector in R?
我正在尝试使用binom.confint
计算均值周围的置信区间。
我的数据以百分比表示,如下所示:
data<-c(56.8, 34.9, 45.3, 52.3, 48.6, 51.5, 45.2,55.2,40.4,42.7)
and n=10
我一直在查看其他 R 脚本,但其中大多数使用以下语法:
library(binom)
binom.confint(x, n, conf.level = 0.95) # here I think X represent each single data points NOT the whole vector (e.g. data).
关于如何进行的任何想法?
计算 Student t检验的 function t.test()
给出置信区间:
> data<-c(56.8, 34.9, 45.3, 52.3, 48.6, 51.5, 45.2,55.2,40.4,42.7)
> t.test(data)
One Sample t-test
data: data
t = 21.687, df = 9, p-value = 4.44e-09
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
42.35727 52.22273
sample estimates:
mean of x
47.29
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.