I have found a lot of software and examples that uses Weighted Generalized Estimating Equations to deal with missing data in a balanced data set (equal time points). However, I have a very high unbalanced data set (patients just come and go whenever they like). How can I use WGEE to handle dropout in this case? Is there software available (R/SAS)?
1 Answer
The R package wgeesel implements weighted GEE approach for longitudinal data with dropout or monotone missingness under missing-at-random assumption. For weighted GEE, however, you need to specify a model for the missingness, which in some cases is not straightforward. Another way to deal with missing data would be multiple imputation. With clustered data, a multilevel multiple imputation approach would be appropriate. The R package jomo is a useful tool for this (see also an introduction to jomo by the maintainer here). Below is an example using the dataset cereb
from package BCgee:
library(missForest)
library(magrittr)
library(dplyr)
library(jomo)
library(mitml)
library(BCgee)
library(gee)
data(cereb)
Introduce 10% missingness to variables Drug
and y
:
cereb.na <- cbind(cereb[1:2],prodNA(cereb[3:4],0.1))
Prepare data; make sure binomial variables are factor, then perform imputations.
cereb.na$Drug <- as.factor(cereb.na$Drug)
cereb.na$y <- as.factor(cereb.na$y)
cereb.na$Period <- as.factor(cereb.na$Period)
Y <- cereb.na %>% select(Drug,y)
clus <- cereb.na %>% select(id)
X<-Z<-cereb.na %>% select(Period)
X$const <- 1
Z$const <- 1
jomo.cereb <- jomo(Y,X=X,Z=Z,clus=clus,nimp=5,output=F)
Transform the imputations to a list:
listjomo.cereb <- jomo2mitml.list(jomo.cereb)
Apply GEE. Note that subject identification was id
in the original dataset, but in the imputed dataset its name is clus
.
imp.gee <- lapply(listjomo.cereb, function(x) {
gee(as.numeric(y) - 1 ~ Period + Drug, id = as.factor(clus), data=x, family=binomial)
})
Create a function to extract covariance matrices from the GEE results. Then obtain pooled estimates using Rubin's rules:
vcov.gee <- function(x) {
return(x$robust.variance)
}
testEstimates(imp.gee)
-
$\begingroup$ I would keep it simple and use a full likelihood method that only assumes missing at random (not missing completely at random like GEE, and that does not use an inefficient weighted analysis). Full likelihood methods include Markov processes, generalized least squares, and mixed effects models. $\endgroup$ Commented May 23 at 11:45