Title: | Quadratic Inference Function |
---|---|
Description: | Developed to perform the estimation and inference for regression coefficient parameters in longitudinal marginal models using the method of quadratic inference functions. Like generalized estimating equations, this method is also a quasi-likelihood inference method. It has been showed that the method gives consistent estimators of the regression coefficients even if the correlation structure is misspecified, and it is more efficient than GEE when the correlation structure is misspecified. Based on Qu, A., Lindsay, B.G. and Li, B. (2000) <doi:10.1093/biomet/87.4.823>. |
Authors: | Zhichang Jiang [aut], Peter Song [aut], Michael Kleinsasser [cre] |
Maintainer: | Michael Kleinsasser <[email protected]> |
License: | GPL-2 |
Version: | 1.5 |
Built: | 2024-11-04 05:49:20 UTC |
Source: | https://github.com/umich-biostatistics/qif |
The data set consists of seizure counts for 59 individuals with epilepsy. Counts were recorded for four two-week periods (8 weeks total). Age is the only covariate.
epil
epil
A data.frame
with 236 rows and 9 variables (columns):
the count for the 2-week period.
treatment, "placebo" or "progabide".
the counts in the baseline 8-week period.
subject's age, in years.
0/1 indicator variable of period 4.
subject number, 1 to 59.
period, 1 to 4.
log-counts for the baseline period, centred to have zero mean.
log-ages, centred to have zero mean.
Thall, P. F. and Vail, S. C. (1990) Some covariance models for longitudinal count data with over-dispersion. Biometrics 46, 657–671.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer.
MS data
exacerb
exacerb
An object of class data.frame
with 765 rows and 14 columns.
Thal
Venab
Print a qif
model object.
## S3 method for class 'qif' print(x, digits = NULL, quote = FALSE, prefix = "", ...)
## S3 method for class 'qif' print(x, digits = NULL, quote = FALSE, prefix = "", ...)
x |
the |
digits |
number of digits to print. |
quote |
logical, indicating whether or not strings should be printed with surrounding quotes. |
prefix |
string, only |
... |
further arguments passed to or from other methods. |
The invisible object from the arguments.
Zhichang Jiang, Alberta Health Services, and Peter X.K. Song, University of Michigan.
Prints the summary of a qif
object.
## S3 method for class 'summary.qif' print(x, digits = NULL, quote = FALSE, prefix = "", ...)
## S3 method for class 'summary.qif' print(x, digits = NULL, quote = FALSE, prefix = "", ...)
x |
the |
digits |
number of digits to print. |
quote |
logical, indicating whether or not strings should be printed with surrounding quotes. |
prefix |
string, only |
... |
further arguments passed to or from other methods. |
The invisible object from the arguments.
The invisible object from the arguments.
Zhichang Jiang, Alberta Health Services, and Peter X.K. Song, University of Michigan.
Produces an object of class "qif
" which is a Quadratic Inference Function fit
of the balanced longitudinal data.
qif(formula = formula(data), id = id, data = parent.frame(), b = NULL, tol = 1e-08, maxiter = 1000, family = gaussian, corstr = "independence", invfun = "finv")
qif(formula = formula(data), id = id, data = parent.frame(), b = NULL, tol = 1e-08, maxiter = 1000, family = gaussian, corstr = "independence", invfun = "finv")
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: |
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()
".
A list containing:
title
: name of qif
version
: the current version of qif
model
: analysis model for link function, variance function and correlation struture
terms
: analysis model for link function, variance function and correlation struture
iteration
: the number of iterations
coefficients
: beta esitmates value
linear.perdictors
: linear predictor value
fitted.value
: fitted value of y
x
: the perdicted matrix
y
: the response
residuals
: y-mu
pearson.resi
: pearson residuals
scale
: the scale of fitted model
family
: the type of distribution
id
: model fitted value
max.id
: max number of each steps
xnames
: the values are X name of qif
statistics
: The qif statistics
Xnames
: the name X matrix in qif
parameter
: parameter estimates
covariance
: Covariance of coefficients
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.
Zhichang Jiang, Alberta Health Services, and Peter X.K. Song, University of Michigan.
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.
glm, lm, formula.
## 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
## 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
Procuce a summary of a qif
object.
## S3 method for class 'qif' summary(object, correlation = TRUE, ...)
## S3 method for class 'qif' summary(object, correlation = TRUE, ...)
object |
an object for which a summary is desired. |
correlation |
binary, include correlation. |
... |
additional arguements to be passed to |
The summary.qif
object.
Zhichang Jiang, Alberta Health Services, and Peter X.K. Song, University of Michigan.