比例的可信区间
you want to form a confidence interval for the population’s proportion
公卫家园
Use the prop.test function. Suppose the sample size is n and the sample contains x
successes:
> prop.test(x, n)
The function output includes the confidence interval for p.
公卫论坛
prop.test(6, 9)
1-sample proportions test with continuity correction
data: 6 out of 9, null probability 0.5
公卫家园
X-squared = 0.4444, df = 1, p-value = 0.505
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.3091761 0.9095817 公卫百科
sample estimates:
p
0.6666667
By default, prop.test calculates a confidence interval at the 95% confidence level. Use 公卫百科
the conf.level argument for other confidence levels, like this:
> prop.test(x, n, p, conf.level=0.99) # 99% confidence level
附件列表
词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。