Learn R Programming

epiR (version 2.0.78)

epi.sssimpleestc: Sample size to estimate a continuous outcome using simple random sampling

Description

Sample size to estimate a continuous outcome using simple random sampling.

Usage

epi.sssimpleestc(N = NA, xbar, sigma, epsilon, error = "relative",
   nfractional = FALSE, conf.level = 0.95)

Value

Returns an integer defining the required sample size.

Arguments

N

scalar integer, the total number of individuals eligible for inclusion in the study. If N = NA the number of individuals eligible for inclusion is assumed to be infinite.

xbar

scalar number, the expected mean of the continuous variable to be estimated.

sigma

scalar number, the expected standard deviation of the continuous variable to be estimated.

epsilon

scalar number, the maximum difference between the estimate and the unknown population value expressed in absolute or relative terms.

error

character string. Options are absolute for absolute error and relative for relative error.

nfractional

logical, return fractional sample size.

conf.level

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

Details

A finite population correction factor is applied to the sample size estimates when a value for N is provided.

References

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

Scheaffer RL, Mendenhall W, Lyman Ott R (1996). Elementary Survey Sampling. Duxbury Press, New York, pp. 95.

Otte J, Gumm I (1997). Intra-cluster correlation coefficients of 20 infections calculated from the results of cluster-sample surveys. Preventive Veterinary Medicine 31: 147 - 150.

Examples

Run this code
## EXAMPLE 1:
## A city contains 20 neighbourhood health clinics and it is desired to take a 
## sample of clinics to estimate the total number of persons from all these 
## clinics who have been given, during the past 12 month period, prescriptions 
## for a recently approved antidepressant. If we assume that the average number 
## of people seen at these clinics is 1500 per year with the standard deviation 
## equal to 300, and that approximately 5% of patients (regardless of clinic) 
## are given this drug, how many clinics need to be sampled to yield an estimate 
## that is within 20% of the true population value?

pmean <- 1500 * 0.05; psigma <- (300 * 0.05)
epi.sssimpleestc(N = 20, xbar = pmean, sigma = psigma, epsilon = 0.20, 
   error = "relative", nfractional = FALSE, conf.level = 0.95)

## Four clinics need to be sampled to meet the requirements of the survey. 


## EXAMPLE 2:
## We want to estimate the mean bodyweight of deer on a farm. There are 278
## animals present. We anticipate the mean body weight to be around 200 kg
## and the standard deviation of body weight to be 30 kg. We would like to
## be 95% certain that our estimate is within 10 kg of the true mean. How
## many deer should be sampled?

epi.sssimpleestc(N = 278, xbar = 200, sigma = 30, epsilon = 10, 
   error = "absolute", nfractional = FALSE, conf.level = 0.95)

## A total of 28 deer need to be sampled to meet the requirements of the survey.

Run the code above in your browser using DataLab