sample.RDS: Draw RDS Sample

Description Usage Arguments Details Value Author(s) References Examples

Description

This function draws a respondent-driven sample (RDS) from a social network.

Usage

1
sample.RDS(traits, adj.mat, n, num.seeds, num.samp, num.prob, replace)

Arguments

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 num.samp + 1 which sum to 1, the probability of each respondent recruiting 0, 1, ..., num.samp new respondents, with default c(0, ..., 1).

replace

a boolean, whether sampling from the social network is performed with replacement, with default TRUE.

Details

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.

Value

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, node1 lists the respondent (source) nodes and node2 lists the recruited (destination) nodes.

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.

Author(s)

Aaron J. Baraff

Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>

References

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

Examples

1
2
3
4
5
## 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)

Example output



RDStreeboot documentation built on May 2, 2019, 6:47 a.m.