View source: R/weight_responses.R
weight_responses | R Documentation |
calculates sampling weights for the questionnaire responses
weight_responses(
cluster_bg,
n_obs,
N,
lvl,
sublvl,
previous_sublvl,
sampling_method,
cluster_labels,
resp_labels,
sum_pop,
verbose
)
cluster_bg |
dataset with background questionnaire |
n_obs |
list with the number of elements per level |
N |
list of numeric vector with the population size of each sampled cluster element on each level |
lvl |
number of the current level |
sublvl |
number of the current sub-level (element within level) |
previous_sublvl |
number of the sub-level of the parent level |
sampling_method |
can be "SRS" for Simple Random Sampling or "PPS" for Probabilities Proportional to Size |
cluster_labels |
character vector with the names of each cluster level |
resp_labels |
character vector with the names of the questionnaire respondents on each level |
sum_pop |
total population at each level (sampled or not) |
verbose |
if |
Input data frame (cluster_bg
) with three new columns for the sampling weights.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.