Title: | Modified Variance Estimators for Generalized Estimating Equations |
---|---|
Description: | Generalized estimating equations with the original sandwich variance estimator proposed by Liang and Zeger (1986), and eight types of more recent modified variance estimators for improving the finite small-sample performance. |
Authors: | Ming Wang <[email protected]> |
Maintainer: | Zheng Li <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.3 |
Built: | 2024-11-12 06:31:32 UTC |
Source: | CRAN |
Generalized estimating equations with the original sandwich variance estimator proposed by Liang and Zeger (1986), and eight types of more recent modified variance estimators for improving the finite small-sample performance.
Generalized estimating equations with the original sandwich variance estimator proposed by Liang and Zeger (1986), and eight types of more recent modified variance estimators for improving the finite small-sample performance.
GEE.var.pan(), GEE.var.gst() and GEE.var.wl() are only for the balanced data, while the others can be used for both balanced and unbalanced data.
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
De Backer M, De Vroey C, Lesaffre E, Scheys I, De Keyser P. Twelve weeks of continuous oral therapy for toenail onychomycosis caused by dermatophytes: a double-blind comparative trial of terbinafine 250 mg/day versus itraconazole 200 mg/day. Journal of the American Academy of Dermatology 1998; 38: 57-63.
Fay MP and Graubard BI. Small-sample adjustments for Wald-type tests using sandwich estimators. Biometrics 2001;57: 1198-1206.
Gosho M, Sato Y and Takeuchi H. Robust covariance estimator for small-sample adjustment in the generalized estimating equations: A simulation study. Science Journal of Applied Mathematics and Statistics 2014;2(1):20-25.
Kauermann G and Carroll RJ. A note on the efficiency of sandwich covariance matrix estimation. Journal of the American Statistical Association 2001;96: 1387-1398.
Morel JG, Bokossa MC, and Neerchal NK. Small sample correction for the variance of GEE estimators. Biometrical Journal 2003;45(4): 395-409.
MacKinnon JG. Some heteroskedasticity-consistent covariance matrix estimators with improved finite sample properties. Journal of Econometrics 1985;29: 305-325.
Mancl LA and DeRouen TA. A covariance estimator for GEE with improved small-sample properties. Biometrics 2001;57: 126-134.
Pan W. On the robust variance estimator in Generalized Estimating Equations. Biometrika 2001;88: 901-906.
Pottho R. F. and Roy, S. W. A generalized multivariate analysis of variance model useful especially for growth curve problems. Biometrika 1964;51:313-326
Thall PF, and Vail SC. Some covariance models for longitudinal count data with overdispersion. Biometrics 1990; 46: 657-671.
Wang M and Long Q. Modified robust variance estimator for generalized estimating equations with improved small-sample performance. Statistics in Medicine 2011;30(11): 1278-1291.
Zeger SL and Liang KY. Longitudinal data analysis for discrete and continuous outcomes. Biometrics 1986; 121-130.
GEE.var.lz()
GEE.var.mk()
GEE.var.kc()
GEE.var.pan()
GEE.var.fg()
GEE.var.gst()
GEE.var.md()
GEE.var.mbn()
GEE.var.wl()
### Run the data analysis using the package using seizure dataset (Poisson); data(seizure) seizure$subject <- 1:length(seizure[,1]) data_alt <- reshape(seizure, direction="long", idvar="subject", timevar="Time", varying=names(seizure)[1:4], v.names="response", times=1:4) data_alt <- data_alt[order(data_alt$subject),] data_alt <- data_alt[,c(4,1:3,5,6)] ### independence working correlation structure; formula <- response~base+trt+Time lz.ind <- GEE.var.lz(formula,id="subject",family=poisson, data_alt,corstr="independence") mk.ind <- GEE.var.mk(formula,id="subject",family=poisson, data_alt,corstr="independence") pan.ind <- GEE.var.pan(formula,id="subject",family=poisson, data_alt,corstr="independence") gst.ind <- GEE.var.gst(formula,id="subject",family=poisson, data_alt,corstr="independence") kc.ind <- GEE.var.kc(formula,id="subject",family=poisson, data_alt,corstr="independence") md.ind <- GEE.var.md(formula,id="subject",family=poisson, data_alt,corstr="independence") fg.ind <- GEE.var.fg(formula,id="subject",family=poisson,data_alt, corstr="independence",b=0.75) mbn.ind <- GEE.var.mbn(formula,id="subject",family=poisson,data_alt, corstr="independence",d=2,r=1) wl.ind <- GEE.var.wl(formula,id="subject",family=poisson, data_alt,corstr="independence")
### Run the data analysis using the package using seizure dataset (Poisson); data(seizure) seizure$subject <- 1:length(seizure[,1]) data_alt <- reshape(seizure, direction="long", idvar="subject", timevar="Time", varying=names(seizure)[1:4], v.names="response", times=1:4) data_alt <- data_alt[order(data_alt$subject),] data_alt <- data_alt[,c(4,1:3,5,6)] ### independence working correlation structure; formula <- response~base+trt+Time lz.ind <- GEE.var.lz(formula,id="subject",family=poisson, data_alt,corstr="independence") mk.ind <- GEE.var.mk(formula,id="subject",family=poisson, data_alt,corstr="independence") pan.ind <- GEE.var.pan(formula,id="subject",family=poisson, data_alt,corstr="independence") gst.ind <- GEE.var.gst(formula,id="subject",family=poisson, data_alt,corstr="independence") kc.ind <- GEE.var.kc(formula,id="subject",family=poisson, data_alt,corstr="independence") md.ind <- GEE.var.md(formula,id="subject",family=poisson, data_alt,corstr="independence") fg.ind <- GEE.var.fg(formula,id="subject",family=poisson,data_alt, corstr="independence",b=0.75) mbn.ind <- GEE.var.mbn(formula,id="subject",family=poisson,data_alt, corstr="independence",d=2,r=1) wl.ind <- GEE.var.wl(formula,id="subject",family=poisson, data_alt,corstr="independence")
Get necessary information (i.e., the number of clusters, cluster sizes) of the data set.
cluster.size(id)
cluster.size(id)
id |
The variable name of the cluster id in the data set. |
This function will get the number of clusters and cluster sizes of the data set.
n |
a vector of numbers denote the cluster sizes for different id. |
m |
the total number of clusters in the data set. |
Ming Wang <[email protected]> Maintainer: Zheng Li <[email protected]>
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
The dental data consists of 27 subjects from the University of North Carolina Dental School.
dental
dental
subject:cluster id
gender:the sex of subject
age_8:the measurements at age 8
age_10:the measurements at age 10
age_12:the measurements at age 12
age_14:the measurements at age 14
The data was collected by investigators at the University of North Carolina Dental School. It is a study of orthodontic measurements on children including 11 girls and 16 boys measured at ages 8, 10, 12, and 14.
Pottho R. F. and Roy, S. W. A generalized multivariate analysis of variance model useful especially for growth curve problems. Biometrika 1964;51:313-326
Calculate the modified GEE variance estimator proposed by Fay and Graubard (2001).
GEE.var.fg(formula,id,family=gaussian,data,corstr="independence",b=0.75)
GEE.var.fg(formula,id,family=gaussian,data,corstr="independence",b=0.75)
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
b |
adjustment factor in the proposed variance estimator, which is prespecfied subjectively to avoid extreme adjustments when the cluster size is close to 1. The default value is 0.75. |
Fit the model by GEE and calculate the variance estimator proposed by Fay and Graubard (2001).
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Fay MP and Graubard BI. Small-sample adjustments for Wald-type tests using sandwich estimators. Biometrics 2001;57: 1198-1206.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender fg.ind <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; fg.exch <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; fg.ar1 <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; fg.unstr <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender fg.ind <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; fg.exch <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; fg.ar1 <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; fg.unstr <- GEE.var.fg(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the modified GEE variance estimator proposed by Gosho et al. (2014).
GEE.var.gst(formula,id,family=gaussian,data,corstr="independence")
GEE.var.gst(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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). |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and provide the variance estimator based on Gosho et al.(2014). Gosho et al (2014) proposed to made an additional modification on Pan's estimator.
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Gosho, M., Sato, Y. and Takeuchi, H. Robust covariance estimator for small-sample adjustment in the generalized estimating equations: A simulation study. Science Journal of Applied Mathematics and Statistics 2014;2(1):20-25.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender gst.ind <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; gst.exch <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; gst.ar1 <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; gst.unstr <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender gst.ind <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; gst.exch <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; gst.ar1 <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; gst.unstr <- GEE.var.gst(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the modified GEE variance estimator proposed by Kauermann and Carroll (2001).
GEE.var.kc(formula,id,family=gaussian,data,corstr="independence")
GEE.var.kc(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and calculate the bias-corrected sandwich variance estimator proposed by Kauermann and Carroll(2001).
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Kauermann G and Carroll RJ. A note on the efficiency of sandwich covariance matrix estimation. Journal of the American Statistical Association 2001;96: 1387-1398.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender kc.ind <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; kc.exch <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; kc.ar1 <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; kc.unstr <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender kc.ind <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; kc.exch <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; kc.ar1 <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; kc.unstr <- GEE.var.kc(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the GEE original variance estimator proposed by Liang and Zeger (1986).
GEE.var.lz(formula,id="subject",family=gaussian,data,corstr="independence")
GEE.var.lz(formula,id="subject",family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and calculate the original variance estimator proposed by Liang and Zeger (1986).
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Zeger SL and Liang KY. Longitudinal data analysis for discrete and continuous outcomes. Biometrics 1986: 121-130.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender lz.ind <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; lz.exch <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; lz.ar1 <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; lz.unstr <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender lz.ind <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; lz.exch <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; lz.ar1 <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; lz.unstr <- GEE.var.lz(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the modified GEE variance estimator proposed by Morel, Bokossa and Neerchal (2003).
GEE.var.mbn(formula,id,family=gaussian,data,corstr="independence",d=2,r=1)
GEE.var.mbn(formula,id,family=gaussian,data,corstr="independence",d=2,r=1)
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
d |
adjustment factor in the variance estimator. The default value is 2. Details see Morel, Bokossa and Neerchal (2003). |
r |
adjustment factor in the variance estimator. The default value is 1. Details see Morel, Bokossa and Neerchal (2003). |
Fit the model by GEE and calculate the variance estimator proposed by Morel, Bokossa and Neerchal (2003).
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Morel JG, Bokossa MC, and Neerchal NK. Small sample correction for the variance of GEE estimators. Biometrical Journal 2003;45(4): 395-409.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender mbn.ind <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="independence",d=2,r=1) ##Independence correlation structure; mbn.exch <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable",d=2,r=1) ##Exchangeable correlation structure; mbn.ar1 <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="AR-M",d=2,r=1) ##AR-1 correlation structure; mbn.unstr <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="unstructured",d=2,r=1) ##Unstructured correlation structur;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender mbn.ind <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="independence",d=2,r=1) ##Independence correlation structure; mbn.exch <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable",d=2,r=1) ##Exchangeable correlation structure; mbn.ar1 <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="AR-M",d=2,r=1) ##AR-1 correlation structure; mbn.unstr <- GEE.var.mbn(formula,id="subject",family=gaussian, data_alt,corstr="unstructured",d=2,r=1) ##Unstructured correlation structur;
Calculate the modified GEE variance estimator proposed by Mancl and DeRouen (2001).
GEE.var.md(formula,id,family=gaussian,data,corstr="independence")
GEE.var.md(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and calculate the variance estimator proposed by Mancl and DeRouen (2001).
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Mancl LA and DeRouen TA. A Covariance Estimator for GEE with Improved Small- Sample Properties. Biometrics 2001;57: 126-134.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender md.ind <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; md.exch <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; md.ar1 <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; md.unstr <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender md.ind <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; md.exch <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; md.ar1 <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; md.unstr <- GEE.var.md(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the variance estimators proposed by Mackinnon (1985).
GEE.var.mk(formula,id,family=gaussian,data,corstr="independence")
GEE.var.mk(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and calculate the variance estimator proposed by Mackinnon (1985). This estimator improved the sandwich variance estimator by ajusting the degree of freedom.
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
MacKinnon JG. Some heteroskedasticity-consistent covariance matrix estimators with improved finite sample properties. Journal of Econometrics 1985;29: 305-325.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender mk.ind <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; mk.exch <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; mk.ar1 <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; mk.unstr <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender mk.ind <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; mk.exch <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; mk.ar1 <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; mk.unstr <- GEE.var.mk(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the modified GEE variance estimator proposed by Pan (2001).
GEE.var.pan(formula,id,family=gaussian,data,corstr="independence")
GEE.var.pan(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
it the model by GEE and calculate the variance estimator proposed by Pan(2001). There are two assumptions for the model: 1) The conditional variance is correctly specified; 2) A common correlation structure exists across all subjects.
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Pan W. On the Robust Variance Estimator in Generalized Estimating Equations. Biometrika 2001;88: 901-906.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender pan.ind <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; pan.exch <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; pan.ar1 <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; pan.unstr <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender pan.ind <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; pan.exch <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; pan.ar1 <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; pan.unstr <- GEE.var.pan(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Calculate the modified GEE variance estimator proposed by Wang and Long (2011).
GEE.var.wl(formula,id,family=gaussian,data,corstr="independence")
GEE.var.wl(formula,id,family=gaussian,data,corstr="independence")
formula |
an object of class "formula" (or one that can be coerced to that class): a formula expression as for other regression models to be fitted, of the form response ~ predictors. The details of formula specification can be seen in glm() and gee(). |
id |
a vector which identifies the clusters. The length of id should be the same as the total number of observations. Data is assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula. |
family |
a family object: a list of functions and expressions for defining link and variance functions to be used in the model. This can be a character string naming a family function including "gaussian", "binomial", and "poisson". See family for details of family functions in glm() and gee(). |
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 glm is called. |
corstr |
a character string specifying working correlation structure: "independence", "AR-M","exchangeable", "unstructured" are possible. |
Fit the model by GEE and calculate the variance estimator proposed by Wang and Long (2011). Two assumptions need to be satisfied: 1) The conditional variance is correctly specified; 2) A common correlation structure exists across all subjects.
cov.beta |
estimate of the variance for beta |
cov.var |
estimate of the variance-covariance matrix for the variance estimator |
Ming Wang <[email protected]>
Maintainer: Zheng Li <[email protected]>
Wang M and Long Q. Modified robust variance estimator for generalized estimating equations with improved small-sample performance. Statistics in Medicine 2011;30(11): 1278-1291.
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender wl.ind <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; wl.exch <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; wl.ar1 <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; wl.unstr <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
data(dental) data_alt <- reshape(dental, direction="long", timevar="Time", varying=names(dental)[3:6], v.names="response", times=c(8,10,12,14)) data_alt <- data_alt[order(data_alt$subject),] data_alt$gender <- as.numeric(data_alt$gender) data_alt$Time <- sqrt(data_alt$Time) formula <- response~Time+gender wl.ind <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="independence") ##Independence correlation structure; wl.exch <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="exchangeable") ##Exchangeable correlation structure; wl.ar1 <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="AR-M") ##AR-1 correlation structure; wl.unstr <- GEE.var.wl(formula,id="subject",family=gaussian, data_alt,corstr="unstructured") ##Unstructured correlation structure;
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
Being used to calculate variance estimator by the functions in this package. It cannot be directly used in other packages.
The data consists of 59 subjects from the randomized progabide trial.
seizure
seizure
base:baseline epiliptic seizure counts
trt:the indicator for treatment (1=progabide; 0=control)
age:baseline age for each subject
y1:epiliptic seizure counts in the first week
y2:epiliptic seizure counts in the second week
y3:epiliptic seizure counts in the third week
y4:epiliptic seizure counts in the forth week
The outcome is the count number of epiliptic seizures in each of four consecutive two-week intervals, and the variables recorded include baseline epiliptic seizure counts in an eight-week interval prior to the treatment assignment, the indicator for treatment (1=progabide; 0=control), and baseline age.
Thall PF, and Vail SC. Some covariance models for longitudinal count data with overdispersion. Biometrics 1990; 46: 657-671.
The data frame consists of 250 patients from a multicenter study comparing to treatments for toenail infection.
toenail
toenail
ID: patient id. The variable for cluster id
Response: toenail infection status: 0=none or mild; 1=moderate or severe
Treatment: 1=oral treatment A; 0=oral treatment B
Month: the exact time point of measurement in month
Visit: the visit index
In a randomized, double-blinded multicenter study, treatment A and B were compared to treat toenail infection disease. Patientes were evaluated for the degree of onycholysis. There are 1908 measurements in total.
De Backer M, De Vroey C, Lesaffre E, Scheys I, De Keyser P. Twelve weeks of continuous oral therapy for toenail onychomycosis caused by dermatophytes: a double-blind comparative trial of terbinafine 250 mg/day versus itraconazole 200 mg/day. Journal of the American Academy of Dermatology 1998; 38: 57-63.