You are here

Univariate ACE model for a binary variable

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

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

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

Try the umx CRAN package?

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

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

tbates's picture
Offline
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:

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 = '')