You are here

Univariate ACE model for a binary variable

4 posts / 0 new
Last post
Hilton28's picture
Joined: 07/16/2020 - 18:34
Univariate ACE model for a binary variable


Does anyone have an OpenMx script for running a Univariate ACE model for a binary variable? I would like to determine the proportion of variance accounted for by additive genetic, shared, and unique environment for a binary variable that indicates whether someone is or is not a member of a certain class of psychopathology.

Thank you in advance!

jpritikin's picture
Joined: 05/24/2012 - 00:35

Try the umx CRAN package?

Leo's picture
Joined: 01/09/2020 - 14:36
check out here:

check out here:

and here:

tbates's picture
Joined: 07/31/2009 - 14:25
umxACE(selVars = "myOrd", ...)

umx::umxACE() will do the right thing with your binary variable.

Just make sure your binary variable is a factor (the umxFactor() helper can be useful here too). Here's the example from the help:

# Cut BMI column to form ordinal obesity variables
obLevels = c('normal', 'overweight', 'obese')
cuts = quantile(twinData[, "bmi1"], probs = c(.5, .2), na.rm = TRUE)
twinData$obese1=cut(twinData$bmi1, breaks=c(-Inf,cuts,Inf), labels=obLevels)
twinData$obese2=cut(twinData$bmi2, breaks=c(-Inf,cuts,Inf), labels=obLevels)
# Make the ordinal variables into umxFactors
ordDVs = c("obese1", "obese2")
twinData[, ordDVs] = umxFactor(twinData[, ordDVs])
mzData = twinData[twinData$zygosity %in% "MZFF", ]
dzData = twinData[twinData$zygosity %in% "DZFF", ]
# Model and summary!
m1= umxACE(selDVs= "obese", dzData= dzData, mzData= mzData, sep= '')
# And controlling age (otherwise manifests appearance as latent C)
m1 = umxACE(selDVs = "obese", selCov= "age", dzData = dzData, mzData = mzData, sep = '')