This is a sub-function of cluster_gen
that performs cluster sampling, with the twist that each cluster level has its own questionnaire.
cluster_gen_separate(
n_levels,
n,
N,
sum_pop,
calc_weights,
sampling_method,
cluster_labels,
resp_labels,
collapse,
n_X,
n_W,
cat_prop,
c_mean,
sigma,
cor_matrix,
rho,
theta,
whitelist,
verbose,
...
)
number of cluster levels
numeric vector or list with the number of sampled observations (clusters or subjects) on each level
population size of each sampled cluster element on each level. Either a numeric vector or a list of numeric vectors. If N
is a list, it must have the same length as n
and each element of N
must have the same length as the corresponding element of n
total population at each level (sampled or not)
if TRUE
, sampling weights are calculated
can be "SRS" for Simple Random Sampling, "PPS" for Probabilities Proportional to Size, "mixed" to use PPS for schools and SRS otherwise, or a vector with the sampling method for each level
character vector with the names of each cluster level
character vector with the names of the questionnaire respondents on each level
if TRUE
, function output contains only one data frame with all answers. It can also be "none", "partial" and "full" for finer control on 3+ levels
list of n_X
per cluster level
list of n_W
per cluster level
list of cumulative proportions for each item. If theta
= TRUE
, the first element of cat_prop
must be a scalar 1, which
corresponds to the theta
.
vector of means for the continuous variables or list of vectors for the continuous variables for each level
vector of standard deviations for the continuous variables or list of vectors for the continuous variables for each level
Correlation matrix between all variables (except weights)
intraclass correlation (scalar, vector or list, as appropriate)
if TRUE
, the first continuous variable will be labeled
'theta'. Otherwise, it will be labeled 'q1'.
used when n = select(...)
, determines which PSUs get to generate questionnaires
if TRUE
, prints output messages
Additional parameters to be passed to questionnaire_gen()
cluster_gen()
cluster_gen_together()