Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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, nfractional = FALSE, 
   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.

nfractional

logical, return fractional sample size.

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.

Author(s)

Mark Stevenson (Faculty of Veterinary and Agricultural Sciences, The University of Melbourne, Australia).

Javier Sanchez (Atlantic Veterinary College, University of Prince Edward Island, Charlottetown Prince Edward Island, C1A 4P3, Canada).

References

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

Examples

## 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, nfractional = FALSE, 
   conf.level = 0.95)

## A total of 55 herds should be sampled: 11 small, 18 medium, and 28 large.

epiR

Tools for the Analysis of Epidemiological Data

v2.0.19
GPL (>= 2)
Authors
Mark Stevenson <mark.stevenson1@unimelb.edu.au> and Evan Sergeant <evansergeant@gmail.com> with contributions from Telmo Nunes, Cord Heuer, Jonathon Marshall, Javier Sanchez, Ron Thornton, Jeno Reiczigel, Jim Robison-Cox, Paola Sebastiani, Peter Solymos, Kazuki Yoshida, Geoff Jones, Sarah Pirikahu, Simon Firestone, Ryan Kyle, Johann Popp, Mathew Jay and Charles Reynard.
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.