Description Usage Arguments Details References See Also Examples
View source: R/finite_pop_sampling.R
Approximate (1-alpha)100% confidence interval for proportion of a population
1 |
n |
Sample size |
pest |
Estimated positive proportion |
N |
Population size (default implies infinite population) |
alpha |
The confidence interval is (1-alpha)*100% |
Note that this value is generally similar to that obtained with the
sampling based approach in truepos_given_sample
when
pest=0.5
but becomes an increasingly bad approximation as the
proportion tends to 0 or 1.
See https://onlinecourses.science.psu.edu/stat414/node/264
Other population-sampling: required.sample.size
,
sample_finite_population
,
truepos_given_sample
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 95% confidence interval for population size 43, sample size 10 and estimated
# proportion of 0.1 ...
# expressed as a proportion
prop.ci(10, pest=0.1, N=43)
# as a number of positives
prop.ci(10, pest=0.1, N=43)*43
## Compare with sampling based calculation
prop.ci(10, pest=0.5, N=48, alpha=.1)*48
summary(truepos_given_sample(samplepos = 5, n=10, N=48))
# more different
prop.ci(10, pest=0.2, N=48, alpha=.1)*48
summary(truepos_given_sample(samplepos = 2, n=10, N=48))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.