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
)

Arguments

data

pass-through population data frame

sampling_variable

character string that is used as prefix for all variables generated by RDS sampling (sample identifier, recruiter ID, wave, time of show-up)

hidden_var

character string specifying hidden variable name (associated probability of visibility should be named p_visible_[hidden_var]). Defaults to "hidden" for the simulations

target_type

one of 'sample' or 'waves'

n_seed

number of seeds randomly drawn from members of hidden population (group K)

n_coupons

number of unique coupons given to each study participant

n_waves

number of waves allowed. Disregarded in target_type = 'sample'

target_n_rds

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

add_seeds

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

arrival_rate

numeric rate of respondent arrival per interval of time (e.g. per hour or day). Defaults to 5

linktrace

character string indicating either "all" or name of variable to use in RDS+ sample to sample from. Default is NULL

drop_nonsampled

logical indicating whether to drop units that are not sampled. Default is FALSE

Value

Population or sample data frame for single study with RDS sample characteristics added

[sampling_variable]

Sampling indicator

[sampling_variable]_from

ID of respondent who enrolled current respondent

[sampling_variable]_t

Time at which respondent was enrolled

[sampling_variable]_wave

Number of steps respondent is away from the seed (seeds are wave 0)

[sampling_variable]_own_coupon

ID of the coupon with which respondent was enrolled

[sampling_variable]_coupon_[1-9]

IDs of the coupons that were given to respondent for enrollment from their network

Examples

if (FALSE) {
sample_rds(data = get_pop_network())
}