Hi!
I am not very familiar with this subject, but I tried your code and the code below worked for me. The only noteworthy difference I made was changing the name of the dataset from nhanes_imp to boys_imp. Could it be that this was just the mistake?
-----------------------------------------------------------------------------------
# download pacman package
install.packages("pacman")
# loads relevant packages using the pacman package
pacman::p_load(
dplyr,
semTools,
mice )
# make 10 dataset using mice
boys_imp <- boys %>%
mice(.,
m = 3,
cluster.seed = 1234)
# set up model
fit <- "sem =~ age + bmi + hc + hgt + wgt"
# run model
out1 <- semTools::runMI(fit,
data = boys_imp, # changed this name!
miPackage = "mice",
fun="sem",
seed = 12345)
# get results
summary(out1, fit.measures = T)
------------------------------------------------------------------------------------
Best wishes,
Jasper Bogaert
---------------------
PhD student and teaching assistant
Department of Data Analysis (PP01)
Faculty of Psychology and Educational Sciences
Ghent University