gtreg {binGroup} | R Documentation |
gtreg is a function to fit the group testing regression model specified through a symbolic description of the linear predictor and descriptions of the group testing setting.
gtreg(formula, data, groupn, sens = 1, spec = 1, linkf = c("logit", "probit", "cloglog"), method = c("Vansteelandt", "Xie"), ...) gtreg.fit(resp, cova, groupn, sens, spec, linkf, optim.meth = "Nelder-Mead") EM(resp, cova, groupn, sens, spec, linkf, EM.maxiter = 1000)
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of
the model to be fitted. The details of model specification are given under 'Details'.
|
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data
frame) containing the variables in the model. If not found in data, the variables are taken from
environment(formula), typically the environment from which gtreg is called.
|
groupn |
a vector, list or data frame of the group numbers that designates individuals to groups. |
sens |
sensitivity of the test, set to be 1 by default. |
spec |
specificity of the test, set to be 1 by default. |
linkf |
a character string specifying one of the three link functions for a binomial model: "logit"
(default) or "probit" or "cloglog".
|
method |
The method to fit the model, must be one of "Vansteelandt" (default) or "Xie". The option "Vansteelandt" finds estimates by directly maximizing the likelihood function based on the group responses while the option "Xie" uses the EM algorithm to maximize the likelihood function in terms of the unobserved individual responses. |
resp |
For gtreg.fit and EM: the vector of the group response variable |
cova |
For gtreg.fit and EM: the design matrix of the covariates |
optim.meth |
For gtreg.fit: the method in optim to fit the full model (default is "Nelder-Mead") |
EM.maxiter |
For EM: The maximal number of iterations in the EM algorithm if "Xie" is chosen. |
... |
In gtreg: arguments to be passed to gtreg.fit or EM. |
A typical predictor has the form groupresp ~ covariates where response is the (numeric) group response vector and covariates is a series of terms which specifies a linear predictor for individual responses. Note that it is actually the unobserved individual responses, not the observed group responses, which are modeled by the covariates here. In groupresp, a 0 denotes a negative response and a 1 denotes a positive response, where the probability of an individual positive response is being modeled directly. A terms specification of the form first + second indicates all the terms in first together with all the terms in second with duplicates removed. The terms in the formula will be re-ordered so that main effects come first, followed by the interactions, all second-order, all third-order and so on; to avoid this pass a terms object as the formula.
A specification of the form first:second indicates the set of terms obtained by taking the interactions of all terms in first with all terms in second. The specification first*second indicates the cross of first and second. This is the same as first + second + first:second.
Two workhorse functions gtreg.fit and EM, which corresponds to Vansteelandt's and Xie's method respectively, are called by gtreg to carry out the model fitting. The gtreg.fit function uses the optim function to maximize the likelihood function written in terms of the group responses. The EM function applies Xie's EM algorithm to the likelihood function written in terms of the unobserved individual responses; the function uses optim to maximize the likelihood function in each M step. The EM algorithm usually converges more slowly than the method of Vansteelandt. There could be slight differences in the estimates between the two methods due to different convergence criteria.
Note the data used here should be in the form of simple pooling - meaning that each individual appears in exactly one pool. Also, no individual tests or retests are used in the model fitting.
For the background on the use of optim, see help(optim).
gtreg returns an object of class "gt". See later in this section.
The function summary (i.e., summary.gt
) can be used to obtain or print a summary of the results.
The group testing functions predict (i.e., predict.gt
) and residuals (i.e., residuals.gt
) can be used to extract various useful features of the value returned by gtreg.
An object of class "gt" is a list containing at least the following components:
coefficients |
a named vector of coefficients |
hessian |
estimated Hessian matrix of the negative log likelihood function, as an estimator of the information matrix |
residuals |
the response residuals, difference of the observed group responses and the fitted group responses. |
fitted.group.values |
the fitted mean values of group responses. |
deviance |
the deviance between the fitted model and the saturated model. |
aic |
Akaike's An Information Criterion, minus twice the maximized log-likelihood plus twice the number of coefficients |
null.deviance |
The deviance for the null model, comparable with deviance. The null model will include only the intercept if there is one in the model. |
counts |
For Vansteelandt's method: the number of iterations in optim; For Xie's method: the number of iterations in the EM algorithm. |
df.residual |
the residual degrees of freedom. |
df.null |
the residual degrees of freedom for the null model. |
z |
the vector of group responses. |
call |
the matched call. |
formula |
the formula supplied. |
terms |
the terms object used. |
method |
the method ("Vansteelandt" or "Xie") used to fit the model. |
link |
the link function used in the model. |
Boan Zhang
Xie, M. (2001), Regression analysis of group testing samples, Statistics in Medicine, 20, 1957-1969.
Vansteelandt, S., Goetghebeur, E., and Verstraeten, T. (2000), Regression models for disease prevalence with diagnostic tests on pools of serum samples, Biometrics, 56, 1126-1133.
summary.gt
, predict.gt
and residuals.gt
for gt methods.
gtreg.mp
for the group testing regression model in the matrix pooling setting.
data(hivsurv) fit1 <- gtreg(formula = groupres ~ AGE + EDUC., data = hivsurv, groupn = gnum, sens = 0.9, spec = 0.9, method = "Xie") ## --- Continuing the Example from '?sim.g': set.seed(1125) gt.data<-sim.g(beta.par=c(-9,0.1), number.sample=279, group.size=9) fit2 <- gtreg(formula = groupres ~ x, data = gt.data, groupn = gnum, linkf = "probit")