什么是内部结构mean_cl_normal function并且可以安全地用于置信区间计算?它是如何工作的?
mean_cl_normal是的一部分ggplot.它smean.cl.normal(...)在Hmisc中使用,它使用t分布的分位数来计算置信限.
set.seed(1) # for reproducibility
x <- rnorm(100, mean=5)
library(Hmisc)
smean.cl.normal(x)
# Mean Lower Upper
# 5.108887 4.930665 5.287110
mean(x) + c(0,1,-1) * qt(0.05/2,(length(x)-1))*sd(x)/sqrt(length(x))
# [1] 5.108887 4.930665 5.287110
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1722 次 |
| 最近记录: |