Learn R Programming

sampler (version 0.2.4)

ssamp: Draws stratifed sample without replacement using proportional allocation

Description

Draws stratifed sample without replacement using proportional allocation

Usage

ssamp(df, n, strata, over = 1)

Arguments

df

object containing full 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 stratified sample without replacement

Examples

Run this code
# NOT RUN {
ssamp(df=albania, n=360, strata=qarku, over=0.1)

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

Run the code above in your browser using DataLab