# NOT RUN {
## 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")
# }
# NOT RUN {
# Alternately, use ginv() from package MASS
fit <- qif(y ~ base + trt + lage + V4, id=subject, data=epil,
family=poisson, corstr="AR-1", invfun = "ginv")
# }
# NOT RUN {
# Print summary of QIF fit:
summary(fit)
# }
# NOT RUN {
## 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
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab