tbates / umx

Making Structural Equation Modeling (SEM) in R quick & powerful
https://tbates.github.io/
44 stars 17 forks source link

umxReduceACE does not play nice with umx_set_auto_run() #241

Closed lf-araujo closed 4 months ago

lf-araujo commented 4 months ago

If you try:

library(umx)

umx_set_auto_run(autoRun = F)

     data(twinData)
     mzData = subset(twinData, zygosity == "MZFF")
     dzData = subset(twinData, zygosity == "DZFF")
     m1 = umxACE(selDVs = "bmi", dzData = dzData, mzData = mzData, sep = "")

     # ===========================================================================
     # = Table of parameters + fit comparisons, ready too copy to word processor =
     # ===========================================================================
     umxReduce(m1, silent=TRUE, digits=2, repo="h")

You will get:

You gave me an ACE model
Error in if (-2 * logLik(ACE) > -2 * logLik(ADE)) { : 
  missing value where TRUE/FALSE needed
tbates commented 4 months ago

'guess I need to hard code autorun in the model runs inside umxReduce.* functions. Will look at it

tbates commented 4 months ago

traceback is so helpful :-)

traceback()
2: umxReduce.MxModelACE(m1, silent = TRUE, digits = 2, repo = "h") at fit_and_reporting.R#230
1: umxReduce(m1, silent = TRUE, digits = 2, repo = "h")

and global settings are the work of the devil 💯 :-)

tbates commented 4 months ago

fixed now