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
)Input data frame (`cluster_bg`) with three new columns for the sampling weights.
dataset with background questionnaire
list with the number of elements per level
list of numeric vector with the population size of each *sampled* cluster element on each level
number of the current level
number of the current sublevel (element within level)
number of the sublevel of the parent level
can be "SRS" for Simple Random Sampling or "PPS" for Probabilities Proportional to Size
character vector with the names of each cluster level
character vector with the names of the questionnaire respondents on each level
total population at each level (sampled or not)
if `TRUE`, prints output messages