Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confidence interval of coefficients using Generalized Estimating Equation (GEE)

I am running the linear regression models using generalized estimating equation with geepack. The confint(fit) command does not seem to work in here. For example:

f2 <- geeglm(FEV1 ~ Age, data = Hospdata, family=gaussian, id=HHID)  
summary(f2)
confint(f2)

I get the following error message in running confint(f2):

> confint(f2)
Waiting for profiling to be done...
Error in `[.data.frame`(summ$coefficients, , "Std. Error", drop = FALSE) : undefined columns selected

Is there any way to find the confidence interval in here?

like image 547
mani Avatar asked Jan 19 '14 19:01

mani


People also ask

What is a pitfall of a generalized estimating equation GEE approach?

Limitations: There is no likelihood function since the GEE does not specify completely the joint distribution; thus some do not consider it a model but just a method of estimation. Likelihood-based methods are NOT available for testing fit, comparing models, and conducting inferences about parameters.

What is the GEE method?

Generalized Estimating Equations, or GEE, is a method for modeling longitudinal or clustered data. It is usually used with non-normal data such as binary or count data. The name refers to a set of equations that are solved to obtain parameter estimates (ie, model coefficients).

Is GEE a GLM?

GEE is an extension of generalized linear models (GLM) for the analysis of longitudinal data. In this method, the correlation between measurements is modeled by assuming a working correlation matrix.


2 Answers

Something like this:

library(geepack)
data(dietox)
dietox$Cu     <- as.factor(dietox$Cu)
mf1 <- formula(Weight~Cu*poly(Time,3))
gee1 <- geeglm(mf1, data=dietox, id=Pig,
               family=poisson("identity"),corstr="ar1")
cc <- coef(summary(gee1))
citab <- with(as.data.frame(cc),
     cbind(lwr=Estimate-1.96*Std.err,
           upr=Estimate+1.96*Std.err))
rownames(citab) <- rownames(cc)

For convenience, you could write a confint method that encapsulates this:

confint.geeglm <- function(object, parm, level = 0.95, ...) {
    cc <- coef(summary(object))
    mult <- qnorm((1+level)/2)
    citab <- with(as.data.frame(cc),
                  cbind(lwr=Estimate-mult*Std.err,
                        upr=Estimate+mult*Std.err))
    rownames(citab) <- rownames(cc)
    citab[parm,]
}

confint(gee1)
like image 104
Ben Bolker Avatar answered Oct 23 '22 07:10

Ben Bolker


I used Ben's reply but also found this works: broom:tidy(f2, conf.int = TRUE)

like image 27
its.me.adam Avatar answered Oct 23 '22 08:10

its.me.adam