Part 4 hiddenmeta
documentation
4.1 get_study_population
: Simulate single population with given network structure
Description
Simulate single population with given network structure
Usage
get_study_population(
N = 2000,
K = 2,
prev_K = c(known = 0.3, hidden = 0.1),
rho_K = 0.05,
p_edge_within = list(known = c(0.05, 0.05), hidden = c(0.05, 0.9)),
p_edge_between = list(known = 0.05, hidden = 0.01),
p_visibility = list(hidden = 0.7, known = 0.99),
add_groups = list(service_use = 0.3, loc_1 = 0.3, loc_2 = 0.1, loc_3 = 0.2, known_2 =
0.1, known_3 = 0.2),
directed = FALSE
)
Arguments
Argument | Description |
---|---|
N |
number of units in population |
K |
number of groups |
prev_K |
named numeric vector of prevalence for each group with last group being hidden |
rho_K |
numeric vector of correlations in group memberships |
p_edge_within |
named list of numeric vectors giving probability of link between in-group members and out-group members for each of groups. The order of objects in list have to follow the order of prev_K |
p_edge_between |
named list of numeric values giving probability of link between in- and out-group member for each of groups. The order of objects in list have to follow the order of prev_K |
p_visibility |
named list of visibility tendencies by group. This is used as mean of Beta distribution (with SD = 0.09) to generate probability of being recognized as member of group, being sampled as seed, etc. The order of objects in list have to follow the order of prev_K |
add_groups |
named list of probabilities of additional group memberships. Examples include probability of service utilization (for service multiplier), going to particular location (for TLS), etc. |
directed |
logical, whether links are directed or undirected |
Value
Population data frame for single study
Examples
list("\n", "get_study_population(\n", " ## total population size for one study\n", " N = 1000,\n", " ## number of groups\n", " ## (K-th group is hidden population we are interested in)\n", " K = 2,\n", " ## probability of membership in each of the groups (prev_K[K] is the true prevalence)\n", " prev_K = c(known = .3, hidden = .1),\n", " ## correlation matrix of group memberships\n", " rho_K = .05,\n", " ## block edge probabilities depending on group memberships\n", " ## 1 - list of in- and out-group probability of links for each group\n",
" ## 2 - probability of link between in- and out-group members\n", " p_edge_within = list(known = c(0.05, 0.05), hidden = c(0.05, 0.9)),\n", " p_edge_between = list(known = 0.05, hidden = 0.01),\n", " ## probability of visibility (show-up) for each group\n", " p_visibility = list(hidden = 1, known = 1),\n", " ## probability of service utilization in hidden population\n", " ## for service multiplier\n", " p_service = 0.3)\n")
4.2 sample_rds
: Draw respondent-driven sample (RDS) sample from single study
Description
Sampling handler for drawing RDS sample with given characteristics from individual study population
Usage
Arguments
Argument | Description |
---|---|
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) |
drop_nonsampled |
logical indicating whether to drop units that are not sampled. Default is FALSE |
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 |
target_type |
one of ‘sample’ or ‘waves’ |
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 |
Value
Population or sample data frame for single study with RDS sample characteristics added
4.3 sample_pps
: Draw proportional sample (PPS) from single study
Description
Sampling handler for drawing proportional sample with given characteristics from individual study population
Usage
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
sampling_variable |
character string that is used as prefix for all variables generated by proportional sampling. Default is ‘pps’ |
drop_nonsampled |
logical indicating whether to drop units that are not sampled. Default is FALSE |
target_n_pps |
target size of proportional sample |
group_pattern |
character string containing regular expression to match all groups used for proportional sampling |
Value
Population or sample data frame for single study with PPS sample characteristics added
4.4 sample_tls
: Draw time-loaction (TLS) sample from single study
Description
Sampling handler for drawing TLS sample with given characteristics from individual study population
Usage
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
sampling_variable |
character string that is used as prefix for all variables generated by TLS sampling. Default is ‘tls’ |
drop_nonsampled |
logical indicating whether to drop units that are not sampled. Default is FALSE |
target_n_tls |
target number of sampled locations |
loc_pattern |
character string containing regular expression to match all locality names in the study population dataset |
Value
Population or sample data frame for single study with TLS sample characteristics added
4.5 get_study_estimands
: Get individual study estimands
Description
Get individual study estimands
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
known_pattern |
character string containing regular expression to match known group names in the study population dataset |
hidden_pattern |
character string containing regular expression to match hidden group name in the study population dataset |
Value
Estimands data frame for single study
4.6 get_study_est_ht
: Horvitz-Thompson prevalence estimator using weighted regression
Description
Horvitz-Thompson prevalence estimator using weighted regression
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
pps_prefix |
character prefix used for RDS sample variables |
Value
Data frame of HT estimates for a single study
4.7 get_study_est_nsum
: NSUM estimatior
Description
NSUM estimatior
Usage
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
pps_prefix |
character prefix used for PPS sample variables |
known_pattern |
character prefix for known population variables |
hidden_pattern |
character prefix for hidden population variable |
degree_ratio |
numeric value between 0 and 1 representing degree ratio |
transmission_rate |
numeric value between 0 and 1 representing information transmission rate |
Value
Data frame of NSUM estimates for a single study with PPS sample
References
Dennis M. Feehan, Matthew J. Salganik. “The networkreporting package.” (2014). https://cran.r-project.org/package=networkreporting .
4.8 get_study_est_chords
: Chords population size estimatior by Berchenko, Rosenblatt and Frost
Description
Chords population size estimatior by Berchenko, Rosenblatt and Frost
Usage
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
type |
a character vector with the type of estimation. Can be one of mle , integrated , jeffreys or leave-d-out . See ?chords::Estimate.b.k and the original paper from the references for details |
rds_prefix |
character prefix used for RDS sample variables |
Value
Data frame of Chords estimates for a single study with RDS sample
References
Berchenko, Yakir, Jonathan D. Rosenblatt, and Simon D. W. Frost. “Modeling and Analyzing Respondent-Driven Sampling as a Counting Process.” Biometrics 73, no. 4 (2017): 1189–98. https://doi.org/10.1111/biom.12678 .
4.9 get_study_est_sspse
: SS-PSE population size estimator by Handcock, Gile and Mar
Description
SS-PSE population size estimator by Handcock, Gile and Mar
Arguments
Argument | Description |
---|---|
data |
pass-through population data frame |
prior_median |
prior median of hidden population size for SS-PSE estimation |
rds_prefix |
character prefix used for RDS sample variables |
Value
Data frame of SS-PSE estimates for a single study
References
Handcock, Mark S., Krista J. Gile, and Corinne M. Mar. “Estimating Hidden Population Size Using Respondent-Driven Sampling Data.” Electronic Journal of Statistics 8, no. 1 (2014): 1491–1521. https://doi.org/10.1214/14-EJS923 .