Learn R Programming

RDStreeboot (version 1.0)

treeboot.RDS: Estimate RDS Quantiles

Description

This function estimates quantiles of numerical traits from a respondent-driven sample (RDS) using the tree bootstrap method.

Usage

treeboot.RDS(samp, quant, B)

Arguments

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 c(0.025, 0.10, 0.90, 0.975).
B
a positive integer, the number of tree bootstrap samples to be drawn, with default 2000.

Value

A matrix with one row for each trait in the RDS. Each row has a single computed quantile corresponding to the input vector quant.

Details

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.

References

Baraff, A. J., McCormick, T. H., and Raftery, A. E., "Estimating uncertainty in respondent-driven sampling using a tree bootstrap method."

Examples

Run this code
## 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)

Run the code above in your browser using DataLab