OpenMx / OpenMx

Repository for the OpenMx Structural Equation Modeling package
http://openmx.ssri.psu.edu
87 stars 35 forks source link

Check that mice interface still works #107

Open mhunter1 opened 6 years ago

mhunter1 commented 6 years ago

In an email from 2017-09-18, the below code was conjectured to work for multiple imputation.

library(EasyMx)
library(mice)

numRepl <- 5
imp <- mice(nhanes2, m=numRepl)
f2 <- with(data=imp, expr=emxRegressionModel(bmi~age+hyp+chl,
                                             type="Joshua", run=T))
summary(pool(f2))

My recollection is that it did at the time. However, now I get two errors: one about the variable names created by making age a factor that has - in the new dummy variable name, and two (once the former is solved) that there is no method glance for MxRAMModel objects. The glance method appears to be in the broom package and is associated with various tibble functionality.

mcneale commented 6 years ago

Something that didn't have a test associated with it is likely to be vulnerable to breaking. It's not clear how easy it would be to add such an animal to the OpenMx test suite; perhaps put in a test in EasyMx?

Either way, looks like we need a fix...

jpritikin commented 6 years ago

If you replace emxRegressionModel with a generic mxModel then we can certainly add a test to OpenMx. It would probably be easy to add some missingness to the famous demoOneFactor dataset and then impute it.

tbates commented 6 years ago

test case: perhaps move to amelia :-)

~/bin/OpenMx/inst/models/failing/mice.R
tbates commented 6 years ago

amelia appears to be faster

http://fastml.com/impute-missing-values-with-amelia

Would remove mice (which compete with guinea pigs) and add a famous adventurer to the includes

mcneale commented 5 years ago

Amelia might excuse the team for getting legless now and then...

tbates commented 5 years ago

Other Amelia :-) Amelia_Earhart_standing_under_nose_of_her_Lockheed_Model_10-E_Electra,_small