Learn R Programming

epiR (version 1.0-15)

epi.ssstrataestb: Sample size to estimate a binary outcome using stratified random sampling

Description

Sample size to estimate a binary outcome using stratified random sampling.

Usage

epi.ssstrataestb(strata.n, strata.Py, epsilon.r, conf.level = 0.95)

Arguments

strata.n

vector of integers, the number of individual listing units in each strata.

strata.Py

vector of numbers, the expected proportion of individual listing units with the outcome of interest for each strata.

epsilon.r

scalar number, the maximum relative difference between the estimate and the unknown population value.

conf.level

scalar number, the level of confidence in the computed result.

Value

A list containing the following:

strata.sample

the estimated sample size for each strata.

strata.total

the estimated total size.

strata.stats

mean the mean across all strata, sigma.bx the among-strata variance, sigma.wx the within-strata variance, and sigma.x the among-strata variance plus the within-strata variance, rel.var the within-strata variance divided by the square of the mean, and gamma the ratio of among-strata variance to within-strata variance.

References

Levy PS, Lemeshow S (1999). Sampling of Populations Methods and Applications. Wiley Series in Probability and Statistics, London, pp. 175 - 179.

Examples

Run this code
# NOT RUN {
## EXAMPLE 1:
## Dairies are to be sampled to determine the proportion of herd managers 
## using foot bathes. Herds are stratified according to size (small, medium, 
## and large). The number of herds in each strata are 1500, 2500, and 4000
## (respectively). A review of the literature indicates that use of foot bathes
## on farms is in the order of 0.50, with the probability of usage increasing
## as herds get larger. How many dairies should be sampled?

strata.n <- c(1500, 2500, 4000)
strata.Py <- c(0.50, 0.60, 0.70)
epi.ssstrataestb(strata.n, strata.Py, epsilon.r = 0.20, conf.level = 0.95)

## A total of 54 herds should be sampled: 10 small, 17 medium, and 27 large.

# }

Run the code above in your browser using DataLab