prop.ci: Approximate (1-alpha)100% confidence interval for proportion...

Description Usage Arguments Details References See Also Examples

View source: R/finite_pop_sampling.R

Description

Approximate (1-alpha)100% confidence interval for proportion of a population

Usage

1
prop.ci(n, pest = 0.5, N = Inf, alpha = 0.05)

Arguments

n

Sample size

pest

Estimated positive proportion

N

Population size (default implies infinite population)

alpha

The confidence interval is (1-alpha)*100%

Details

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.

References

See https://onlinecourses.science.psu.edu/stat414/node/264

See Also

Other population-sampling: required.sample.size, sample_finite_population, truepos_given_sample

Examples

 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))

sfrechter/physplit.analysis documentation built on May 29, 2019, 8:02 p.m.