Package 'Neighboot'

Title: Neighborhood Bootstrap Method for RDS
Description: A bootstrap method for Respondent-Driven Sampling (RDS) that relies on the underlying structure of the RDS network to estimate uncertainty.
Authors: Mamadou Yauck [aut, cre], Erica E. M. Moodie [aut]
Maintainer: Mamadou Yauck <[email protected]>
License: GPL-3
Version: 1.0.1
Built: 2024-11-05 06:38:40 UTC
Source: CRAN

Help Index


Compute standard errors and confidence intervals

Description

This function estimate standard errors and compute confidence intervals from an RDS sample using the neighborhood bootstrap method.

Usage

neighb(RDS.data, quant=c(0.025, 0.975),
      method=c("percentile","Wald"), B=1000)

Arguments

RDS.data

A list containing the following objects:

nodes

a numeric vector containing IDs

edges

a list containing two vectors: node1 for the recruiter's ID and node2 for the recruit's ID.

traits

a data frame containing respondents' traits.

degree

a vector containing each node's degree, or number of social connections.

quant

a vector of positive integers between 0 and 1, representing quantiles to be estimated.

method

a character string representing the method for computing confidence intervals, either percentile or Wald. Default is percentile.

B

the number of bootstrap repetitions. Default is 1000.

Details

The function neighb compute standard errors and confidence intervals using the neighborhood bootstrap method for RDS. Confidence intervals can be computed using the percentile method or the studentized method.

Value

A matrix of estimated standard errors and quantiles. Each row represents a trait.

Author(s)

Mamadou Yauck <[email protected]> and Erica E. M. Moodie.

Examples

#Load the synthetic population network dataset.
data("pop.network")

#Draw an RDS sample from the simulated network using the sampleRDS function
#from the package RDStreeboot.
require(RDStreeboot)
RDS.samp <- sample.RDS(pop.network$traits, pop.network$adj.mat, 200, 10,
 3, c(1/6,1/3,1/3,1/6), FALSE)

#Compute 95\% confidence intervals using the percentile method
neighb(RDS.data=RDS.samp, quant=c(0.025, 0.975),method="percentile", B=100)

Population network

Description

Population network

Usage

pop.network

Format

A list containing two elements:

traits

a dataframe of 2000 rows and 4 columns

adj.mat

an adjacency matrix


Tranform an sample.RDS object to an rds.data.frame object.

Description

This function transforms an output from the sample.RDS function of the RDStreeboot package to an rds.data.frame object of the RDS package.

Usage

to.rds(RDS.data)

Arguments

RDS.data

A list containing the following objects:

nodes

a numeric vector containing IDs

edges

a list containing two vectors: node1 for the recruiter's ID and node2 for the recruit's ID.

traits

a data frame containing respondents' traits.

degree

a vector containing each node's degree, or number of social connections.

Value

An rds.data.frame object.

Author(s)

Mamadou Yauck <[email protected]> and Erica E. M. Moodie.

Examples

#Load the synthetic population network dataset.
data("pop.network")

#Draw an RDS sample from the simulated network using the sampleRDS function
#from the package RDStreeboot.
require(RDStreeboot)
RDS.samp <- sample.RDS(pop.network$traits, pop.network$adj.mat, 200, 10,
 3, c(1/6,1/3,1/3,1/6), FALSE)

#Tranform RDS.samp to an rds.data.frame object
require(RDS)
to.rds(RDS.data=RDS.samp)