R/study_sample_rds.R
sample_rds.Rd
Sampling handler for drawing RDS sample with given characteristics from individual study population
sample_rds(
data,
sampling_variable = "rds",
hidden_var,
target_type = c("sample", "waves"),
n_seed,
n_coupons,
n_waves = NULL,
target_n_rds,
add_seeds = NULL,
arrival_rate = 5,
linktrace = NULL,
drop_nonsampled = FALSE
)
pass-through population data frame
character string that is used as prefix for all variables generated by RDS sampling (sample identifier, recruiter ID, wave, time of show-up)
character string specifying hidden variable name (associated probability of visibility should be named p_visible_[hidden_var]
). Defaults to "hidden" for the simulations
one of 'sample' or 'waves'
number of seeds randomly drawn from members of hidden population (group K)
number of unique coupons given to each study participant
number of waves allowed. Disregarded in target_type = 'sample'
numeric target size of RDS sample. If target_type = "sample"
, this gives maximum number of respondents to be sampled (right now the RDS network can also end before reaching sample size target). If target_type = "waves"
, this gives maximum number of waves of recruitment allowed
numeric indicating how many seeds to add at a time if target sample size is not reached with initial seeds. Additional seeds are randomly drawn from non-sampled hidden population members. Defaults to NULL
that does not allow adding seeds
numeric rate of respondent arrival per interval of time (e.g. per hour or day). Defaults to 5
character string indicating either "all"
or name of variable to use in RDS+ sample to sample from. Default is NULL
logical indicating whether to drop units that are not sampled. Default is FALSE
Population or sample data frame for single study with RDS sample characteristics added
Sampling indicator
ID of respondent who enrolled current respondent
Time at which respondent was enrolled
Number of steps respondent is away from the seed (seeds are wave 0)
ID of the coupon with which respondent was enrolled
IDs of the coupons that were given to respondent for enrollment from their network
if (FALSE) {
sample_rds(data = get_pop_network())
}