ufs (version 0.3.2)

pwr.confIntProp: Estimate required sample size for accuracy in parameter estimation of a proportion

Description

This function uses confIntProp() to compute the required sample size for estimating a proportion with a given accuracy.

Usage

pwr.confIntProp(prop, conf.level = 0.95, w = 0.1, silent = TRUE)

Arguments

prop

The proportion you expect to find, or a vector of proportions to enable easy sensitivity analyses.

conf.level

The confidence level of the desired confidence interval.

w

The desired 'halfwidth' of the confidence interval.

silent

Whether to provide a lot of information about progress ('FALSE') or not ('TRUE').

Value

A single numeric value (the sample size).

Examples

Run this code
# NOT RUN {
### Required sample size to estimate a prevalence of .03 in the
### population with a confidence interval of a maximum half-width of .01
pwr.confIntProp(.03, w=.01);

### Vectorized over prop, so you can easily see how the required sample
### size varies as a function of the proportion
pwr.confIntProp(c(.03, .05, .10), w=.01);
# }

Run the code above in your browser using DataLab