Learn R Programming

sampler (version 0.2.4)

ssampcalc: Determines sample size by strata using proportional allocation

Description

Determines sample size by strata using proportional allocation

Usage

ssampcalc(df, n, strata, over = 0)

Arguments

df

object containing sampling data frame (e.g. data)

n

sample size (integer) or object containing sample size

strata

variable in sampling data frame by which to stratify (e.g. region)

over

(optional) desired oversampling proportion (defaults to 0; takes value between 0 and 1 as input)

Value

Returns proportional sample size per strata (rounded up to nearest integer)

References

[1] Sampling Design & Analysis, S. Lohr, 1999, 4.4

Examples

Run this code
# NOT RUN {
ssampcalc(df=albania, n=544, strata=qarku, over=0.05)

size <- rsampcalc(nrow(albania), 3, 95, 0.5)
ssampcalc(albania, size, qarku)
# }

Run the code above in your browser using DataLab