View source: R/build_run_modify.R
umxGxE_window | R Documentation |
Make a 2-group GxE (moderated ACE) model using LOSEM. In GxE interaction studies, typically, the hypothesis that the strength of genetic influence varies parametrically (usually linear effects on path estimates) across levels of environment. Of course, the function linking genetic influence and context is not necessarily linear, but may react more steeply at the extremes, or take other, unknown forms. To avoid obscuring the underlying shape of the interaction effect, local structural equation modeling (LOSEM) may be used, and GxE_window implements this. LOSEM is a non-parametric, estimating latent interaction effects across the range of a measured moderator using a windowing function which is walked along the context dimension, and which weights subjects near the center of the window highly relative to subjects far above or below the window center. This allows detecting and visualizing arbitrary GxE (or CxE or ExE) interaction forms.
umxGxE_window(
selDVs = NULL,
moderator = NULL,
mzData = mzData,
dzData = dzData,
sep = NULL,
weightCov = FALSE,
target = NULL,
width = 1,
plotWindow = FALSE,
tryHard = c("no", "yes", "ordinal", "search"),
return = c("estimates", "last_model")
)
selDVs |
The dependent variables for T1 and T2, e.g. c("bmi_T1", "bmi_T2") |
moderator |
The name of the moderator variable in the dataset e.g. "age", "SES" etc. |
mzData |
Dataframe containing the DV and moderator for MZ twins |
dzData |
Dataframe containing the DV and moderator for DZ twins |
sep |
(optional) separator, e.g. "_T" which will be used expand base names into full variable names: e.g.: 'bmi' –> c("bmi_T1", "bmi_T2") |
weightCov |
Whether to use cov.wt matrices or FIML default = FALSE, i.e., FIML |
target |
A user-selected list of moderator values to test (default = NULL = explore the full range) |
width |
An option to widen or narrow the window from its default (of 1) |
plotWindow |
whether to plot the data window. |
tryHard |
Default ('no') uses normal mxRun. "yes" uses mxTryHard. Other options: "ordinal", "search" |
return |
whether to return the last model (useful for specifiedTargets) or the list of estimates (default = "estimates") |
Table of estimates of ACE along the moderator
Hildebrandt, A., Wilhelm, O, & Robitzsch, A. (2009) Complementary and competing factor analytic approaches for the investigation of measurement invariance. Review of Psychology, 16, 87–107.
Briley, D.A., Harden, K.P., Bates, T.C., Tucker-Drob, E.M. (2015). Nonparametric Estimates of Gene x Environment Interaction Using Local Structural Equation Modeling. Behavior Genetics, 45, 581-96. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10519-015-9732-8")}.
umxGxE()
Other Twin Modeling Functions:
power.ACE.test()
,
umx
,
umxACE()
,
umxACEcov()
,
umxACEv()
,
umxCP()
,
umxDiffMZ()
,
umxDiscTwin()
,
umxDoC()
,
umxDoCp()
,
umxGxE()
,
umxGxEbiv()
,
umxIP()
,
umxMRDoC()
,
umxReduce()
,
umxReduceACE()
,
umxReduceGxE()
,
umxRotate.MxModelCP()
,
umxSexLim()
,
umxSimplex()
,
umxSummarizeTwinData()
,
umxSummaryACE()
,
umxSummaryACEv()
,
umxSummaryDoC()
,
umxSummaryGxEbiv()
,
umxSummarySexLim()
,
umxSummarySimplex()
,
umxTwinMaker()
## Not run:
library(umx);
# ==============================
# = 1. Open and clean the data =
# ==============================
# umxGxE_window takes a data.frame consisting of a moderator and two DV columns: one for each twin.
# The model assumes two groups (MZ and DZ). Moderator can't be missing
mod = "age" # The full name of the moderator column in the dataset
selDVs = c("bmi1", "bmi2") # The DV for twin 1 and twin 2
data(twinData) # Dataset of Australian twins, built into OpenMx
# The twinData consist of two cohorts: "younger" and "older".
# zygosity is a factor. levels = MZFF, MZMM, DZFF, DZMM, DZOS.
# Delete missing moderator rows
twinData = twinData[!is.na(twinData[mod]), ]
mzData = subset(twinData, zygosity == "MZFF")
dzData = subset(twinData, zygosity == "DZFF")
# ========================
# = 2. Run the analyses! =
# ========================
# Run and plot for specified windows (in this case just 1927)
umxGxE_window(selDVs = selDVs, moderator = mod, mzData = mzData, dzData = dzData,
target = 40, plotWindow = TRUE)
umxGxE_window(selDVs = "bmi", sep="", moderator = mod, mzData = mzData, dzData = dzData,
target = 40, plotWindow = TRUE, tryHard = "yes")
# Run with tryHard
umxGxE_window(selDVs = "bmi", sep="", moderator = "age", mzData = mzData, dzData = dzData)
umxGxE_window(selDVs="bmi", sep="", moderator="age", mzData=mzData, dzData=dzData, tryHard="yes")
# Run creating weighted covariance matrices (excludes missing data)
umxGxE_window(selDVs = "bmi", sep="", moderator= "age", mzData = mzData, dzData = dzData,
weightCov = TRUE)
# This example runs multiple target moderator values
mxGxE_window(selDVs = selDVs, moderator = mod, mzData = mzData, dzData = dzData,
target = c(39,40,50), plotWindow = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.