umxGxE: umxGxE: Implements ACE models with moderation of paths, e.g....

View source: R/build_run_modify.R

umxGxER Documentation

umxGxE: Implements ACE models with moderation of paths, e.g. by SES.

Description

Make a 2-group GxE (moderated ACE) model (Purcell, 2002). GxE interaction studies test the hypothesis that the strength of genetic (or environmental) influence varies parametrically (usually linear effects on path estimates) across levels of environment. umxGxE allows detecting, testing, and visualizing G xE (or C or E x E) interaction forms.

Usage

umxGxE(
  name = "G_by_E",
  selDVs,
  selDefs,
  dzData,
  mzData,
  sep = NULL,
  data = NULL,
  zyg = "zygosity",
  digits = 3,
  lboundACE = NA,
  lboundM = NA,
  dropMissingDef = TRUE,
  dzAr = 0.5,
  dzCr = 1,
  autoRun = getOption("umx_auto_run"),
  tryHard = c("no", "yes", "ordinal", "search"),
  optimizer = NULL
)

Arguments

name

The name of the model (default= "G_by_E")

selDVs

The dependent variable (e.g. "IQ")

selDefs

The definition variable (e.g. "SES")

dzData

The DZ dataframe containing the Twin 1 and Twin 2 DV and moderator (4 columns)

mzData

The MZ dataframe containing the Twin 1 and Twin 2 DV and moderator (4 columns)

sep

How to expand selDVs into full names, i.e., "_T" makes "var" -> "var_T1" and "var_T2"

data

If provided, dzData and mzData are treated as valid levels of zyg to select() data sets (default = NULL)

zyg

If data provided, this column is used to select rows by zygosity (Default = "zygosity")

digits

Rounding precision for tables (default 3)

lboundACE

If not NA, then lbound the main effects at this value (default = NA, can help to set this to 0)

lboundM

If not NA, then lbound the moderator effects at this value (default = NA, can help to set this to 0)

dropMissingDef

Whether to automatically drop missing def var rows for the user (default = TRUE). You get a polite note.

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).

autoRun

Optionally run the model (default), or just to create it and return without running.

tryHard

Optionally tryHard to get the model to converge (Default = 'no'). "yes" uses mxTryHard. Other options: "ordinal", "search".

optimizer

Optionally set the optimizer (default NULL does nothing)

Details

The following figure the GxE model as a path diagram:

Figure: GxE.png

Value

  • GxE mxModel()

References

  • Purcell, S. (2002). Variance components models for gene-environment interaction in twin analysis. Twin Research, 6, 554-571. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1375/twin.5.6.554")}

See Also

umxGxE_window(), umxReduce(), umxSummary()

Other Twin Modeling Functions: power.ACE.test(), umxACEcov(), umxACEv(), umxACE(), umxCP(), umxDiffMZ(), umxDiscTwin(), umxDoCp(), umxDoC(), umxGxE_window(), umxGxEbiv(), umxIP(), umxMRDoC(), umxReduceACE(), umxReduceGxE(), umxReduce(), umxRotate.MxModelCP(), umxSexLim(), umxSimplex(), umxSummarizeTwinData(), umxSummaryACEv(), umxSummaryACE(), umxSummaryDoC(), umxSummaryGxEbiv(), umxSummarySexLim(), umxSummarySimplex(), umxTwinMaker(), umx

Examples

## Not run: 
require(umx)
data(twinData) 
twinData$age1 = twinData$age2 = twinData$age
selDVs  = "bmi"
selDefs = "age"
mzData  = subset(twinData, zygosity == "MZFF")[1:100,]
dzData  = subset(twinData, zygosity == "DZFF")[1:100,]
m1 = umxGxE(selDVs= "bmi", selDefs= "age", sep= "", dzData= dzData, mzData= mzData, tryHard= "yes")

# Select the data on the fly with data= and zygosity levels
m1 = umxGxE(selDVs= "bmi", selDefs= "age", sep="", dzData= "DZFF", mzData= "MZFF", data= twinData)

# ===============================================================
# = example with Twins having different values of the moderator =
# ===============================================================

twinData$age1 = twinData$age2 = twinData$age
tmp = twinData
tmp$age2 = tmp$age2 +rnorm(n=length(tmp$age2))
selDVs  = "bmi"
selDefs = "age"
mzData = subset(tmp, zygosity == "MZFF")
dzData = subset(tmp, zygosity == "DZFF")
m1 = umxGxE(selDVs= "bmi", selDefs= "age", sep= "", dzData= dzData, mzData= mzData, tryHard= "yes")

# ====================================
# = Controlling output of umxSummary =
# ====================================
umxSummaryGxE(m1)
umxSummary(m1, location = "topright")
umxSummary(m1, separateGraphs = TRUE)

m2 = umxModify(m1, regex = "am_.*", comparison = TRUE, tryHard = "yes")

# umxReduce knows how to test all relevant hypotheses for GxE models,
# reporting these in a nice table.
umxReduce(m1)

## End(Not run)

umx documentation built on May 29, 2024, 5:40 a.m.

Related to umxGxE in umx...