Do basic simple random samples based on a provided dataframe.
Takes 3 types of sampling strategies: - Simple random - Stratified 2-stages - Cluster sampling All are based on a random selection of primary survey units (PSU) according to confidence level, margin of error, proportion and survey buffer provided.
kobo_samplingframe( data, strata, pop_col, confidence_level = 0.95, margin_error = 0.05, proportion = 0.5, method, buffer = 0.05 )
data | Data frame containing the population informations |
---|---|
strata | Column name of the data frame to serve as PSU (as character) |
pop_col | Column name of the data frame where is the population figure for each PSU (as character) |
confidence_level | Confidence level to achieve in fraction of one (e.g. 0.95) |
margin_error | Margin of error to achieve in fraction of one (e.g. 0.05) |
proportion | Proportion estimation in fraction of one (e.g. 0.5) |
method | Sampling methode to use. Three options: - "srs" : Simple Random Sample - "strat2st": Stratified 2-stages random sample - "cluster": Cluster sampling |
buffer | Buffer to the sampling target to ensure datacollection, in fraction of one (e.g. 0.05) |
Elliott Messeiller
if (FALSE) { kobo_samplingframe(data=SamplingFrame, strata="Province", pop_col = "Households", confidence_level = 0.95, margin_error = 0.05, proportion = 0.5, method = "strat2st") }