Laura
Laura

Reputation: 1

MANOVA after multiple imputation (mice) in R

I've used the mice package to impute missing data (created 30 imputed datasets) and I want to do a manova and pool te results.

I can't seem to find any code or examples on how to do this, only on regular anova. Can anyone help me?

Thanks!

Upvotes: 0

Views: 438

Answers (1)

hanne
hanne

Reputation: 102

There is no native pooling available for MANOVA with mice. The approximate F values resulting from the manova() call could be pooled using the miceadds package.

# setup
library(mice, warn.conflicts = FALSE)
#> Warning: package 'mice' was built under R version 4.3.1
library(dplyr, warn.conflicts = FALSE)

# impute
imp <- mice(boys, print = FALSE)

# check fit in first imputation
manova(cbind(hgt, wgt) ~ reg, complete(imp))
#> Call:
#>    manova(cbind(hgt, wgt) ~ reg, complete(imp))
#> 
#> Terms:
#>                       reg Residuals
#> hgt               37739.3 1583124.0
#> wgt               15407.5  491740.0
#> Deg. of Freedom         4       743
#> 
#> Residual standard errors: 46.15971 25.72607
#> Estimated effects may be unbalanced

# fit manova for all imputations
fit <- with(imp, manova(cbind(hgt, wgt) ~ reg))

# extract approximate F value from manova output
stats <- purrr::map_dbl(fit$analyses, ~{
  broom::tidy(.x)$statistic[1]
})

# pool approximate F values
miceadds::micombine.F(stats, df = 4)
#> Combination of Chi Square Statistics for Multiply Imputed Data
#> Using 5 Imputed Data Sets
#> F(4, 957842.32)=3.871     p=0.0038

Created on 2023-10-03 with reprex v2.0.2

Upvotes: 0

Related Questions