qif {qif} | R Documentation |
Function to Solve a Quadratic Inference Function Model
Description
Produces an object of class "qif
" which is a Quadratic Inference Function fit
of the balanced longitudinal data.
Usage
qif(formula = formula(data), id = id, data = parent.frame(),
b = NULL, tol = 1e-08, maxiter = 1000, family = gaussian,
corstr = "independence", invfun = "finv")
Arguments
formula |
a formula expression as for other regression models, of the form
|
id |
a vector which identifies the clusters. The length of |
data |
an optional data frame in which to interpret the variables occurring
in the |
b |
an initial estimate for the parameters. |
tol |
the tolerance used in the fitting algorithm. |
maxiter |
the maximum number of iterations. |
family |
a |
corstr |
a character string specifying the correlation structure. The
following are permitted: |
invfun |
a character string specifying the matrix inverse function. The
following are permitted: |
Details
qif
provides two options of computing matrix inverses. The default
is from Fortran math library, and the other one is generalized inverse "ginv
"
given in R package MASS
. You can call option "ginv
" through argument "invfun
"
in "qif()
".
Value
A list containing:
title
: name of qifversion
: the current version of qifmodel
: analysis model for link function, variance function and correlation strutureterms
: analysis model for link function, variance function and correlation strutureiteration
: the number of iterationscoefficients
: beta esitmates valuelinear.perdictors
: linear predictor valuefitted.value
: fitted value of yx
: the perdicted matrixy
: the responseresiduals
: y-mupearson.resi
: pearson residualsscale
: the scale of fitted modelfamily
: the type of distributionid
: model fitted valuemax.id
: max number of each stepsxnames
: the values are X name of qifstatistics
: The qif statisticsXnames
: the name X matrix in qifparameter
: parameter estimatescovariance
: Covariance of coefficients
Note
This R package is created by transplanting a SAS macro QIF developed originally by Peter Song and Zhichang Jiang (2006). This is version 1.5 of this user documentation file, revised 2019-07-02.
Author(s)
Zhichang Jiang, Alberta Health Services, and Peter X.K. Song, University of Michigan.
References
Qu A, Lindsay BG, Li B. Improving generalized estimating equations using quadratic inference functions. Biometrika 2000, 87 823-836.
Qu A, Song P X-K. Assessing robustness of generalised estimating equations and quadratic inference functions. Biometrika 2004, 91 447-459.
Qu A, Lindsay BG. Building adaptive estimating equations when inverse of covariance estimation is difficult. J. Roy. Statist. Soc. B 2003, 65, 127-142.
See Also
glm, lm, formula.
Examples
## Marginal log-linear model for the epileptic seizures count data
## (Diggle et al., 2002, Analysis of Longitudinal Data, 2nd Ed., Oxford Press).
# Read in the epilepsy data set:
data(epil)
# Fit the QIF model:
fit <- qif(y ~ base + trt + lage + V4, id=subject, data=epil,
family=poisson, corstr="AR-1")
# Alternately, use ginv() from package MASS
fit <- qif(y ~ base + trt + lage + V4, id=subject, data=epil,
family=poisson, corstr="AR-1", invfun = "ginv")
# Print summary of QIF fit:
summary(fit)
## Second example: MS study
data(exacerb)
qif_BIN_IND<-qif(exacerbation ~ treatment + time + duration + time2, id=id,
data=exacerb, family=binomial, corstr="independence")
qif_BIN_AR1<-qif(exacerbation ~ treatment + time + duration + time2, id=id,
data=exacerb, family=binomial, corstr="AR-1")
qif_BIN_CS<-qif(exacerbation ~ treatment + time + duration + time2, id=id,
data=exacerb, family=binomial, corstr="exchangeable")
qif_BIN_UN<-qif(exacerbation ~ treatment + time + duration + time2, id=id,
data=exacerb, family=binomial, corstr="unstructured")
summary(qif_BIN_CS)
qif_BIN_CS$statistics
qif_BIN_CS$covariance