Sampling handler for drawing TLS sample with given characteristics from individual study population
sample_tls(
data,
sampling_variable = "tls",
drop_nonsampled = FALSE,
hidden_var = "hidden",
target_n_clusters,
target_cluster_type = c("prop", "fixed"),
target_per_cluster,
clusters
)
pass-through population data frame
character string that is used as prefix for all variables generated by TLS sampling. Default is 'tls'
logical indicating whether to drop units that are not sampled. Default is FALSE
character string specifying hidden variable name (associated probability of visibility should be named p_visible_[hidden_var]
). Defaults to "hidden" for the simulations
target number of clusters (time-locations). Clusters are always sampled proportionally to their size in terms of number of hidden population members
character string specifying the type of TLS sampling within each location. Either "prop" in which case target_per_cluster
should give a share or "fixed" in which case target_per_cluster
should be integer. Default is proportional sampling within clusters
numeric target for within cluster. Either share for proportional sampling or integer for fixed sampling. If in any cluster fixed number of units required for sampling is larger than the number of units in cluster, the whole cluster is sampled and the warning is produced
character string containing names of all locality names in the study population data frame
Population or sample data frame for single study with TLS sample characteristics added
Sampling indicator
Time-locations at which subject was encountered first
Sampled time-locations at which subject is present
Sampled time-locations at which subject was sampled
Sampled time-locations
Sampling weight without visibility
Sampling weight with visibility