neighb: Compute standard errors and confidence intervals

View source: R/neighb.R

neighbR Documentation

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 <yauck.mamadou@uqam.ca> 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)

Neighboot documentation built on June 1, 2022, 1:06 a.m.