I have a daily diary dataset (140obs for 110 persons) which I've analysed using a random slopes and intercept linear mixed model (using FIML). The model has 1 dependent variable, and 5 fixed effects. However, the dataset contains quite a bit of missing data, so I would like to calculate the fraction of missing information using FIML, as specified in the paper by Savalei & Rhemtulla (2012).
However, my mathematical background is such that I really don't understand the specifics mentioned there, so although i'm getting quite good at coding in lme4, I really don't know what I should be doing exactly. I was hoping for some R package to help me out, but I can't find any other then SEM-related packages. As my knowledge of SEM is also close to zero, I have no idea if I can use them (e.g. lavaan, or the fmi function) to get the fraction of missing information for my model.
To be concrete, my question is: is there an easy way of calculating the fraction of missing information for the parameters in a linear mixed model, and if so with what package/software, or can somebody help me understand how to code the procedure suggested by Savalei & Rhemtulla? (for clarity: they describe their step-by-step procedure on page 484 and 485, An estimate of fraction of missing information via FIML
The code for a simulated dataset is as follows:
library(lme4) library(mice) set.seed(1) # simulate dataset Data <- data.frame( ID = rep(1:110, each=140), day = rep(1:28, each=5), group = rep(1:2, each= 140*55), pos_af = runif(15400) * 100 ) Data$ID <- as.factor(Data$ID) Data$group <- as.factor(Data$group) # create missingness rand.num <- sample(x = 1:15400, size = 15400 * 0.2, replace = FALSE) # 20% missingness Data$pos_af[rand.num] <- NA # Mixed model model <- lme4::lmer(pos_af ~ group + day + group * day + I(day^2) + group * I(day^2) + (day|ID), data = Data, REML = FALSE) ## impute imp <- mice::mice(Data) ## Fit models for each imputed dataset. Here you can add the random effects you want, etc fit <- with(data = imp, exp = lme4::lmer(pos_af ~ group + day + group * day + I(day^2) + group * I(day^2) + (day|ID), REML = FALSE)) ## pool results poolFit <- mice::pool(fit) coef(summary(model)) poolFit
With the true dataset the difference between the estimates of the model on the true data vs mice data is a lot larger (factors 10 for example), but these results illustrate my point. The t-values are all over the place, and the estimates are also quite different... Or am I doing something wrong?