Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bootstrap.contingency.test

Performs a bootstrap test of independance between two categorical variables


Description

Performs a bootstrap test of independance between two categorical variables

Usage

bootstrap.contingency.test(
  rds.data,
  row.var,
  col.var,
  number.of.bootstrap.samples = 1000,
  weight.type = c("HCG", "RDS-II", "Arithmetic Mean"),
  table.only = FALSE,
  verbose = TRUE,
  ...
)

Arguments

rds.data

an rds.data.frame

row.var

the name of the first categorical variable

col.var

the name of the second categorical variable

number.of.bootstrap.samples

The number of simulated boootstrap populations

weight.type

The type of weighting to use for the contningency table. Only large sample methods are allowed.

table.only

only returns the weighted table, without bootstrap.

verbose

level of output

...

Additional parameters for compute_weights

Details

This function first estimates a Homophily Configuration Graph model for the underlying network under the assumption that the two variables are independant and that the population size is large. It then draws bootstrap RDS samples from this population distribution and calculates the chi.squared statistic on the weighted contingency table. Weights are calculated using the HCG estimator assuming a large population size.

Examples

data(faux)
bootstrap.contingency.test(rds.data=faux, row.var="X", col.var="Y",
  number.of.bootstrap.samples=50, verbose=FALSE)

RDS

Respondent-Driven Sampling

v0.9-3
LGPL-2.1
Authors
Mark S. Handcock [aut, cre], Krista J. Gile [aut], Ian E. Fellows [aut], W. Whipple Neely [aut]
Initial release
2021-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.