bootstrap.incidence: Calculates incidence and bootstrap confidence intervals for...

View source: R/incidence.R

bootstrap.incidenceR Documentation

Calculates incidence and bootstrap confidence intervals for immunoassay data collected with RDS

Description

Calculates incidence and bootstrap confidence intervals for immunoassay data collected with RDS

Usage

bootstrap.incidence(
  rds.data,
  recent.variable,
  hiv.variable,
  N = NULL,
  weight.type = c("Gile's SS", "RDS-I", "RDS-I (DS)", "RDS-II", "Arithmetic Mean", "HCG"),
  mean.duration = 200,
  frr = 0.01,
  post.infection.cutoff = 730,
  number.of.bootstrap.samples = 1000,
  se.mean.duration = 0,
  se.frr = 0,
  confidence.level = 0.95,
  verbose = TRUE,
  ...
)

Arguments

rds.data

an rds.data.frame

recent.variable

The name of the variable indicating recent infection

hiv.variable

The name of the variable indicating of hiv infection

N

Population size

weight.type

A string giving the type of estimator to use. The options are "Gile's SS", "RDS-I", "RDS-II", "RDS-I/DS", and "Arithemic Mean". It defaults to "Gile's SS".

mean.duration

Estimated mean duration of recent infection (MDRI) (days)

frr

Estimated false-recent rate (FRR)

post.infection.cutoff

Post-infection time cut-off T, separating "true-recent" from "false-recent" results (days)

number.of.bootstrap.samples

The number of bootstrap samples used to construct the interval.

se.mean.duration

The standard error of the mean.duration estimate

se.frr

The standard error of the false recency estimate

confidence.level

The level of confidence for the interval

verbose

verbosity control

...

additional arguments to compute.weights

Details

The recent.variable and hiv should be the names of logical variables. Otherwise they are converted to logical using as.numeric(x) > 0.5.

This function estimates incidence using RDS sampling wieghts. Confidence intervals are constucted using HCG bootstraps. See http://www.incidence-estimation.org/ for additional information on (non-RDS) incidence estimation.

Examples

data(faux)
faux$hiv <- faux$X == "blue"
faux$recent <- NA
faux$recent[faux$hiv] <- runif(sum(faux$hiv)) < .2
faux$recent[runif(nrow(faux)) > .5] <- NA
faux$hiv[is.na(faux$recent)][c(1,6,10,21)] <- NA
attr(faux,"time") <- "wave"
bootstrap.incidence(faux,"recent","hiv",weight.type="RDS-II", number.of.bootstrap.samples=100)

RDS documentation built on Aug. 20, 2023, 9:06 a.m.