公卫百科  > 所属分类  >  R/S+   
[0] 评论[0] 编辑

比例的可信区间

 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

附件列表


0

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

如果您认为本词条还有待完善,请 编辑

上一篇 计算均数的可信区间    下一篇 两样本均数比较

同义词

暂无同义词