1

A lot of my colleagues use FIML in Mplus to address missing data, I'm working on a method comparison study to illustrate some of the advantages/disadvantages of using FIML vs other imputation approaches. All my analysis is done in R so I was hoping to compare treatment effects from FIML using lavaan in R.

I immediately run into two issues:

1) The apparent inability to specify a model comparable to random intercepts from lmer when we have unbalanced groups,

and the most puzzling one

2) The fact that when running a regression in lavaan with missing data (generated by MAR) the estimates are IDENTICAL to those that we get from list wise deletion both in lavaan and using lm()

I generated an example to illustrate this problem below

## stack overflow example

set.seed(1234)
library(MASS)
x       <- rnorm(800,0,3)
site    <- c(rep(seq(1:30),20),rep(seq(1:8),30))[1:800]
# random intercepts by site
reff    <- rnorm(30,1,1)
reffi   <- reff[site]
site_id <- as.factor(site[site])
# treatment variable
t       <- rbinom(30,1,.5)
treat   <- t[site]

## Assume there's an interaction we don't know about, so that the treatment effect would be
## underestimated if we don't address the missingness in x2 correctly
y       <- rnorm(800,3+x+1*(treat*(x-mean(x))^2)+reffi,.2)
data    <- data.frame("y"=y,"x"=x,"treat"=treat,"reffi"=reffi,"site_id"=as.ordered(site_id))

## MAR mechanism
# missingness in y
library(arm)
p                        <- invlogit(-3+x)
missing_y                <- rbinom(800,1,p)
y_miss                   <- y
y_miss[missing_y==1]     <- NA
data$y_miss              <- y_miss


## Say that for our analysis we only care about the average treatment effect, not its interactions


## Ideally we would consider random intercepts
library(lme4)
## Results without missingness
summary(lmer(y~x+treat+(1|site_id),data=data))
## Results with missingness
summary(lmer(y_miss~x+treat+(1|site_id),data=data))
library(lavaan)

## But we can't run random intercepts with lavaan for unbalanced groups, right?
## so, looking at simple regression for comparison with lavaan regression

## Results without missingness
lm_full      <- lm(y~x+treat,data=data)
## Results with missingness
lm_miss      <- lm(y_miss~x+treat,data=data)
summary(lm_full)
summary(lm_miss)

## Nothing changes, results are identical as for linear regression with listwise deletion
## when specifying FIML

summary(lavaan::sem('
                    y_miss~ x + treat 
                    y_miss~1', data,meanstructure=T,missing="listwise"))
summary(lavaan::sem('
                    y_miss~ x + treat 
                    y_miss~1', data,meanstructure=T,missing="fiml"))

Could anyone help me understand why the estimates and their SEs are identical? Is this what we should expect when there's only one outcome whenever we use FIML? Would this work differently in MPlus? Is it a bug in lavaan?

As a bonus, if anyone knows how to run a random intercepts model with FIML in R for unbalanced groups, I'd appreciate if you could direct me to the package or reading.

Thank you!

May
  • 21
  • 2

0 Answers0