tbates / umx

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

compatibility #189

Closed gzhai closed 2 years ago

gzhai commented 2 years ago

data(twinData) dz = subset(twinData, zygosity == "DZFF" & cohort == "younger") mz = subset(twinData, zygosity == "MZFF" & cohort == "younger") m1 = umxACE(selDVs = c("wt"), sep = "", dzData = dz, mzData = mz) Error in umxACE(selDVs = c("wt"), sep = "", dzData = dz, mzData = mz) : could not find function "umxACE"

mcneale commented 2 years ago

library(umx) or require(umx) is needed before using any of its functions.

gzhai commented 2 years ago

yes, I know. It is actually a version compatibility issue, it works with OpenMx version 2.19.8 but not with 2.20.0. And there are some issues to install the old version of OpenMx from the CRAN into Rstudio cloud, but Rstudio package manager helps to install the old version and the problem solved!

mcneale commented 2 years ago

Ah, yes, we are working on some compatibility issues. BTW a bit more text with the initial post would have revealed the issue to be incompatibility rather than forgetting to invoke the library.

tbates commented 2 years ago

This is running fine for me under `umxVersion() 4.11.0, OpenMx 2.20.0, R 4.1.2

data(twinData)
dz = subset(twinData, zygosity == "DZFF" & cohort == "younger")
mz = subset(twinData, zygosity == "MZFF" & cohort == "younger")
m1 = umxACE(selDVs = c("wt"), sep = "", dzData = dz, mzData = mz)

Running ACE with 4 parameters

ACE -2 × log(Likelihood) = 12186.278

Table: Standardized parameter estimates from a 1-factor Cholesky ACE model. A: additive genetic; C: common environment; E: unique environment.

a1 c1 e1
wt 0.922 . 0.388

Table: Means (from model$top$expMean)

wt1 wt2
intercept 57.185 57.185