mlegt: Computes the mle on group testing data.

View source: R/aenetgt.R

mlegtR Documentation

Computes the mle on group testing data.

Description

Computes the mle on group testing data.

Usage

mlegt(
  X,
  Y,
  Z,
  Se,
  Sp,
  binit = NULL,
  tol = 1e-04,
  E.approx = FALSE,
  get.SEs = FALSE
)

Arguments

X

Design matrix with first column a column of 1s.

Y

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

Z

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

Se

A vector of testing sensitivities, where the first element is the testing specificity for pools and the second entry is the test specificity for individual testing, if applicable.

Sp

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

binit

Parameter value at which to initialize the EM-algorithm. The default is b=1, for which an initial value is chosen internally.

tol

Convergence criterion.

E.approx

Logical. If TRUE then E-step done with EYapprox(). If FALSE, then E-step done with EYexact().

get.SEs

Logical. If TRUE then estimated standard errors for the maximum likelihood estimators are returned.

Value

The maximum likelihood estimator.

This function implements an EM-algorithm to find the maximum likelihood estimator based on the observed data X, Y, Z, and the sensitivities and specificities in Se, Sp.

Examples

# generate individual covariate values and disease statuses
N <- 5000
data <- model0(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
mlegt.out <- mlegt(X, Y, Z, Se, Sp, tol = .01) # compute mle

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