Univariate ACE model for a binary variable

Posted on
No user picture. Hilton28 Joined: 07/16/2020
Hello,

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!
Emily

Replied on Thu, 10/22/2020 - 07:21
Picture of user. jpritikin Joined: 05/23/2012

Try the [umx](https://cran.r-project.org/package=umx) CRAN package?
Replied on Fri, 10/23/2020 - 09:35
No user picture. Leo Joined: 01/09/2020

check out here:

https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/GeneticEpi_Matrix.html

and here:

https://vipbg.vcu.edu/vipbg/OpenMx2/docs//OpenMx/latest/Ordinal_Matrix.html

Replied on Fri, 10/23/2020 - 17:25
Picture of user. tbates Joined: 07/31/2009

`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:


require(umx)
data(twinData)
# 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 = '')