EYexact: Computes conditional expectations of individual disease...

View source: R/RcppExports.R

EYexactR Documentation

Computes conditional expectations of individual disease statuses for individual, master pool, or Dorfman testing

Description

Computes conditional expectations of individual disease statuses for individual, master pool, or Dorfman testing

Usage

EYexact(Z, Y, eta, Se, Sp)

Arguments

Z

Group testing output from one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen.

Y

Group testing output from one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen.

eta

the value of the linear predictor

Se

A vector of testing sensitivities of length max(Z[,3]).

Sp

A vector of testing specificities of length max(Z[,3]).

Value

The vector of conditional expectations.

This function computes the conditional expectations of each individual disease status given the observed assay data.

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)
Z <- assay.data$Z
Y <- assay.data$Y
b <- data$b
eta <- X %*% b
EY <- EYexact(Z,Y,eta,Se,Sp)

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