get_ss_prevalence: Function to calculate sample size for estimating...

Description Usage Arguments Value Examples

View source: R/prevalence.R

Description

Function to calculate sample size for estimating prevalence/proportional indicators from a simple random sample (SRS) or a random cluster sample (RCS) survey. This function has an option to apply a finite population correction (FPC) to the sample size calculations.

Usage

1
2
get_ss_prevalence(z = 1.96, p = 0.5, c = 0.1, deff = 2,
  fpc = FALSE, pop = NULL)

Arguments

z

The z-score/z-value for a 95% confidence interval. Typical vaues for z are 1.645 for a 90% confidence interval, 1.75 for a 92% confidence interval, 1.96 for a 95% confidence interval and 2.05 for a 96% confidence interval. Default is 1.96.

p

The numeric value of the expected prevalence/proportion. Default is 0.5 (for 50% prevalence/proportion) as this gives the highest sample size estimate. If previous prevalence/proportion is known, this value can be used for p.

c

The numeric value of the desired precision of the resulting prevalence/proportion estimate. For coverage surveys, default is set at ±10% (0.1).

deff

The numeric for design effect (deff) to account for suvey design. For simple random sample (SRS) surveys, a deff of 1 is used. For a random cluster survey (RCS), a deff of 2 is usually used. If survey data from previous cluster surveys is available, deff can be calculated using deff() function from Hmisc package.

fpc

Logical. Default FALSE. If TRUE, finite population correct (FPC) is applied.

pop

Population size from which sample has been drawn from. If fpc is TRUE, pop is required.

Value

A numeric value for sample size required to estimate the required prevalence/proportion.

Examples

1
2
3
4
  # Calculate sample size to estimate a proportion with 95% confidence
  # interval, an expected proporition of 50%, precision of 10% and a design
  # effect of 2
  get_ss_prevalence(z = 1.96, p = 0.5, c = 0.1, deff = 2)

validmeasures/sampsizer documentation built on Sept. 8, 2019, 11:19 p.m.