R/study_sample_pps.R
sample_pps.Rd
Sampling handler for drawing proportional sample with given characteristics from individual study population
sample_pps(
data,
sampling_variable = "pps",
drop_nonsampled = FALSE,
target_n_pps = 400,
n_clusters = target_n_pps,
sampling_frame = NULL,
strata = NULL,
cluster = NULL,
weights_type = c("absolute", "relative")
)
pass-through population data frame
character string that is used as prefix for all variables generated by proportional sampling. Default is 'pps'
logical indicating whether to drop units that are not sampled. Default is FALSE
target size of proportional sample
number of clusters
character vector containing all binary vectors identifying sampling frame
character vector containing name(s) of stratifying variables. Currently not implemented
character vector containing name(s) of all cluster variables
character string giving the type of weights to compute. Can be one of "absolute" or "relative". Currently only absolute weights are calculated
Population or sample data frame for single study with PPS sample characteristics added
Sampling indicator
Indicator for sampling frame (respondents with 0 cannot be enrolled)
ID of respondent's strata
Proportion of sampling frame in the strata to which respondent belongs
ID of respondent's cluster
Proportion of strata in the cluster to which respondent belongs
Sampling weights