0

I am trying to do forward model selection between marginal models fit with GEE, using Quasi-Akaike Criterion (QIC) as the selection criterion. However, when I use the dredge function from the MuMIn package, my global model is rank-deficient.

On this question a similar problem was resolved by "tricking" MuMIn. This was done by fitting a smaller global model that worked, updating the formula argument of that model, and using that. However, I can't get this to work while using the wgee() function from the wgeesel package.

Here is a reproducible example from R using the IMPS longitudinal dataset.

####Example1
data(imps)
library(wgeesel)
imps.complete <- na.omit(imps)
imps.complete$repd<-imps.complete$Drug #repeat a column to make model rank-deficient
fit <- wgee(IMPS79 ~ Drug+Sex+Time+repd, data=imps.complete, 
            id=imps.complete$ID, family="gaussian",
            corstr="exchangeable", scale=NULL)

gee.min <- wgee(IMPS79 ~ Drug+Sex+Time, data=imps.complete, 
                id=imps.complete$ID, family="gaussian",
                corstr="exchangeable", scale=NULL) #this model can be fit
gee.min$model #IMPS79 ~ Drug + Sex + Time
gee.min$model <- IMPS79 ~ Drug + Sex + Time + repd #update model argument

#try the solution from other stackoverflow page. doesn't work
options(na.action=na.fail)
gee.retry <- model.sel(lapply(
  dredge(gee.min,fixed=c("Drug","Sex"),rank="QIC",evaluate=FALSE),
  eval),rank="QIC")  

# note that the call argument cannot be updated
gee.min$call <- wgee(model = IMPS79 ~ Drug + Sex + Time + repd, data = imps.complete, 
                     id = imps.complete$ID, family = "gaussian", corstr = "exchangeable", 
                     scale = NULL)

The error code I get is "Error in QIC(global.model) : Model matrix is rank deficient; geeglm can not proceed". I am guessing dredge is trying to evaluate QIC on the global model, which it can't do

Any help would be appreciated! I am doing a similar procedure on many different models, and want my methodology to be reproducible, so I am looking for some sort of automated way to do forward model selection using QIC.

dugy1001
  • 13
  • 4

1 Answers1

0

I wasn't able to resolve this problem using the MuMIn package.

However, I found a workaround using the pstools package posted on GitHub by Peter DeWitt. He has a handy function called gee_stepper that performs forward model selection using QIC and outputs results as it goes. I was able to use it for my purposes after making some small edits to the function:

(1) Changing the QIC being used to actual QIC as computed from the MuMIn package; gee_stepper appeared to be using a quasi-likelihood value from the MESS package

(2) Having the function use a user-specified minimum model that e.g. always included certain covariates, rather than using an intercept-only model as a minimum model.

dugy1001
  • 13
  • 4