dorfman.assay.gen: Generates Dorfman testing data.

View source: R/aenetgt.R

dorfman.assay.genR Documentation

Generates Dorfman testing data.

Description

Generates Dorfman testing data.

Usage

dorfman.assay.gen(Y.true, Se, Sp, cj)

Arguments

Y.true

The true disease statuses of the individuals.

Se

A vector of testing sensitivities, where the first element is the testing sensitivity for the master pools and the second entry is the test sensitivity for individual testing.

Sp

A vector of testing specificities, where the first element is the testing specificity for the master pools and the second entry is the test specificity for individual testing.

cj

The size of the master pools (Note: The number of individuals length(Y.true) should be evenly divisible by cj. This is only for decoding purposes; i.e., the regression methods do not require this condition).

Value

A list containing objects Z and Y.

This function simulates Dorfman decoding and stores the testing responses in accordance to the data structure required to fit the group testing regression model presented in Gregory et al. (2018+). For the specifics of this structure see McMahan et al. (2017).

Examples

# generate individual covariate values and disease statuses
N <- 100
data <- model1(N)
X <- data$X
Y.true <- data$Yi
Se <- c(.95,.92) # set master pool and individual assay sensitivity
Sp <- c(.97,.98) # set master pool and individual assay specificity
cj <- 4 # set size of master pools
# subject individuals to Dorfman testing
assay.data <- dorfman.assay.gen(Y.true,Se,Sp,cj)

gregorkb/aenetgt documentation built on Oct. 12, 2022, 11:51 a.m.