Title: | RDS Tree Bootstrap Method |
---|---|
Description: | A tree bootstrap method for estimating uncertainty in respondent-driven samples (RDS). Quantiles are estimated by multilevel resampling in such a way that preserves the dependencies of and accounts for the high variability of the RDS process. |
Authors: | Aaron J. Baraff |
Maintainer: | Aaron J. Baraff <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 1.0 |
Built: | 2024-10-31 20:46:00 UTC |
Source: | CRAN |
A tree bootstrap method for estimating uncertainty in respondent-driven samples (RDS). Quantiles are estimated by multilevel resampling in such a way that preserves the dependencies of and accounts for the high variability of the RDS process.
Package: | RDStreeboot |
Type: | Package |
Version: | 1.0 |
Date: | 2016-11-23 |
License: | GPL-2 | GPL-3 |
The main estimation function is treeboot.RDS
. It produces estimates for the quantiles of traits from a respondent-driven sample (RDS) using the tree bootstrap method. Options allow for different quantiles to be estimated and the number of tree bootstrap samples to be drawn. Also included is a function to draw a random respondent-driven sample (RDS) from a social network (sample.RDS
). A faux social network dataset has been provided for testing and examples (faux.network
).
Aaron J. Baraff
Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>
Baraff, A. J., McCormick, T. H., and Raftery, A. E., "Estimating uncertainty in respondent-driven sampling using a tree bootstrap method."
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE) ## estimate 80% and 95% confidence intervals treeboot.RDS(samp, c(0.025, 0.10, 0.90, 0.975), 2000)
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE) ## estimate 80% and 95% confidence intervals treeboot.RDS(samp, c(0.025, 0.10, 0.90, 0.975), 2000)
This dataset contains a faux social network created for testing and examples.
data("faux.network")
data("faux.network")
A list with two components:
a data frame, the first column giving ID numbers for the nodes in the social network and the remaining columns giving continuous or discrete (not categorical) traits for each node.
a matrix of 0's and 1's, the adjacency matrix for the social network.
This faux social network contains 1000 nodes and 5000 edges with each node having three binary traits labeled "X", "Y", and "Z".
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE)
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE)
This function draws a respondent-driven sample (RDS) from a social network.
sample.RDS(traits, adj.mat, n, num.seeds, num.samp, num.prob, replace)
sample.RDS(traits, adj.mat, n, num.seeds, num.samp, num.prob, replace)
traits |
a data frame, the first column giving ID numbers for the nodes in the social network and the remaining columns giving continuous or discrete (not categorical) traits for each node. |
adj.mat |
a matrix of 0's and 1's, the adjacency matrix for the social network. |
n |
a positive integer, the size of the sample to be drawn, with default 100. |
num.seeds |
a positive integer, the number of seeds from which the RDS begins, with default 1. |
num.samp |
a positive integer, the maximum number of recruits for each respondent, with default 2. |
num.prob |
a vector of positive numbers with length |
replace |
a boolean, whether sampling from the social network is performed with replacement, with default |
The function sample.RDS
draws a random respondent-driven sample (RDS) from a social network. First, seeds are drawn with probability proportional to degree. Then each respondent successively recruits additional respondents until the desired sample size is attained. Options allow for different numbers of seeds, the number and probability distribution of recruits, and whether or not sampling is done with replacement. Each call to the function results in a single RDS realization.
A list with four components:
nodes |
a vector of numbers, the ID numbers of the drawn nodes in the social network. |
edges |
a list of two vectors of positive integers, the edge list of the RDS. For each edge, |
degree |
a vector of positive integers, the degree of each sampled node in the social network. |
traits |
a data frame, the columns giving continuous or discrete (not categorical) traits for each node. |
Aaron J. Baraff
Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>
Baraff, A. J., McCormick, T. H., and Raftery, A. E., "Estimating uncertainty in respondent-driven sampling using a tree bootstrap method."
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE)
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE)
This function estimates quantiles of numerical traits from a respondent-driven sample (RDS) using the tree bootstrap method.
treeboot.RDS(samp, quant, B)
treeboot.RDS(samp, quant, B)
samp |
A list with four components:
|
quant |
a vector of numbers between 0 and 1, the quantiles to be estimated for each trait, with default |
B |
a positive integer, the number of tree bootstrap samples to be drawn, with default 2000. |
The function treeboot.RDS
estimates the quantiles of traits from a respondent-driven sample (RDS) using the tree bootstrap method. Options allow for different quantiles to be estimated and the number of tree bootstrap samples to be drawn.
A matrix with one row for each trait in the RDS. Each row has a single computed quantile corresponding to the input vector quant
.
Aaron J. Baraff
Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>
Baraff, A. J., McCormick, T. H., and Raftery, A. E., "Estimating uncertainty in respondent-driven sampling using a tree bootstrap method."
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE) ## estimate 80% and 95% confidence intervals treeboot.RDS(samp, c(0.025, 0.10, 0.90, 0.975), 2000)
## load data data(faux.network) ## draw RDS from network samp <- sample.RDS(faux.network$traits, faux.network$adj.mat, 100, 2, 3, c(0,1/3,1/3,1/3), TRUE) ## estimate 80% and 95% confidence intervals treeboot.RDS(samp, c(0.025, 0.10, 0.90, 0.975), 2000)