View source: R/build_run_modify.R
umxACEcov | R Documentation |
Often, researchers include covariates in 2-group Cholesky umxACE()
twin models.
The umxACEcov 'random' option models the covariates in the expected covariance matrix, thus allowing
all data to be preserved. The downside is that this method has a strong assumption
of multivariate normality. Covariates like age, which are perfectly correlated in twins cannot be used.
Covariates like sex, which are ordinal, violate the normality assumption.
Binary and ordinal covariates like sex also violate the normality assumption. Which is most of the use cases :-(.
umxACEcov(
name = "ACEcov",
selDVs,
selCovs,
dzData,
mzData,
sep = NULL,
type = c("Auto", "FIML", "cov", "cor", "WLS", "DWLS", "ULS"),
allContinuousMethod = c("cumulants", "marginals"),
dzAr = 0.5,
dzCr = 1,
addStd = TRUE,
addCI = TRUE,
boundDiag = 0,
equateMeans = TRUE,
bVector = FALSE,
autoRun = getOption("umx_auto_run"),
tryHard = c("no", "yes", "ordinal", "search"),
optimizer = NULL
)
name |
The name of the model (defaults to"ACE"). |
selDVs |
The variables to include from the data (do not include sep). |
selCovs |
The covariates to include from the data (do not include sep). |
dzData |
The DZ dataframe. |
mzData |
The MZ dataframe. |
sep |
Separator text between basename for twin variable names. Often "_T". Used to expand selDVs into full column names, i.e., "dep" –> c("dep_T1", "dep_T2"). |
type |
Analysis method one of c("Auto", "FIML", "cov", "cor", "WLS", "DWLS", "ULS") |
allContinuousMethod |
"cumulants" or "marginals". Used in all-continuous WLS data to determine if a means model needed. |
dzAr |
The DZ genetic correlation (defaults to .5, vary to examine assortative mating). |
dzCr |
The DZ "C" correlation (defaults to 1: set to .25 to make an ADE model). |
addStd |
Whether to add the algebras to compute a std model (defaults to TRUE). |
addCI |
Whether to add intervals to compute CIs (defaults to TRUE). |
boundDiag |
= Whether to bound the diagonal of the a, c, and e matrices. |
equateMeans |
Whether to equate the means across twins (defaults to TRUE). |
bVector |
Whether to compute row-wise likelihoods (defaults to FALSE). |
autoRun |
Whether to run the model (default), or just to create it and return without running. |
tryHard |
Default ('no') uses normal mxRun. "yes" uses mxTryHard. Other options: "ordinal", "search" |
optimizer |
optionally set the optimizer. Default (NULL) does nothing. |
The following figure shows how the ACE model with random covariates appears as a path diagram:
OpenMx::mxModel()
of subclass mxModel.ACEcov
Neale, M. C., & Martin, N. G. (1989). The effects of age, sex, and genotype on self-report drunkenness following a challenge dose of alcohol. Behavior Genetics, 19, 63-78. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF01065884")}.
Schwabe, I., Boomsma, D. I., Zeeuw, E. L., & Berg, S. M. (2015). A New Approach to Handle Missing Covariate Data in Twin Research : With an Application to Educational Achievement Data. Behavior Genetics, 46, 583-95. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10519-015-9771-1")}.
Other Twin Modeling Functions:
power.ACE.test()
,
umx
,
umxACE()
,
umxACEv()
,
umxCP()
,
umxDiffMZ()
,
umxDiscTwin()
,
umxDoC()
,
umxDoCp()
,
umxGxE()
,
umxGxE_window()
,
umxGxEbiv()
,
umxIP()
,
umxMRDoC()
,
umxReduce()
,
umxReduceACE()
,
umxReduceGxE()
,
umxRotate.MxModelCP()
,
umxSexLim()
,
umxSimplex()
,
umxSummarizeTwinData()
,
umxSummaryACE()
,
umxSummaryACEv()
,
umxSummaryDoC()
,
umxSummaryGxEbiv()
,
umxSummarySexLim()
,
umxSummarySimplex()
,
umxTwinMaker()
## Not run:
# ============================================
# = BMI, can't use Age as a random covariate =
# ============================================
require(umx)
data(twinData)
# Replicate age to age1 & age2
twinData$age1 = twinData$age2 = twinData$age
mzData = subset(twinData, zygosity == "MZFF")
dzData = subset(twinData, zygosity == "DZFF")
# =====================================================================
# = Trying to use identical var (like age) as a random cov is ILLEGAL =
# =====================================================================
m1 = umxACEcov(selDVs = "bmi", selCovs = "age", dzData = dzData, mzData = mzData, sep = "")
# ========================================================
# = Use an lm-based age-residualisation approach instead =
# ========================================================
resid_data = umx_residualize("bmi", "age", suffixes = 1:2, twinData)
mzData = subset(resid_data, zygosity == "MZFF")
dzData = subset(resid_data, zygosity == "DZFF")
m2 = umxACE("resid", selDVs = "bmi", dzData = dzData, mzData = mzData, sep = "")
# Univariate BMI without covariate of age for comparison
mzData = subset(twinData, zygosity == "MZFF")
dzData = subset(twinData, zygosity == "DZFF")
m3 = umxACE("raw_bmi", selDVs = "bmi", dzData = dzData, mzData = mzData, sep = "")
# ===========================================================================
# = A bivariate example (need a dataset with a VIABLE COVARIATE to do this) =
# ===========================================================================
selDVs = "wt" # Set the DVs
selCovs = "ht" # Set the COV
selVars = umx_paste_names(selDVs, covNames = selCovs, sep = "", sep = 1:2)
mzData = subset(twinData, zygosity == "MZFF")
dzData = subset(twinData, zygosity == "DZFF")
m1 = umxACEcov(selDVs = selDVs, selCovs = selCovs,
dzData = dzData, mzData = mzData, sep = "", autoRun = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.