Univariate ACE model for a binary variable
Posted on
Hilton28
Joined: 07/16/2020
Attachment | Size |
---|---|
Screen Shot 2020-10-20 at 9.47.51 PM.png | 99.46 KB |
Forums
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
umx
Log in or register to post comments
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
Log in or register to post comments
umxACE(selVars = "myOrd", ...)
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 = '')
Log in or register to post comments