Learn R Programming

umx (version 4.0.0)

umxSimplex: Build and run a simplex twin model (not ready for use!)

Description

The simplex model provides a powerful tool for theory-based decomposition of genetic and environmental differences. umxSimplex makes a 2-group simplex twin model.

Usage

umxSimplex(
  name = "simplex",
  selDVs,
  dzData,
  mzData,
  sep = NULL,
  equateMeans = TRUE,
  dzAr = 0.5,
  dzCr = 1,
  addStd = TRUE,
  addCI = TRUE,
  autoRun = getOption("umx_auto_run"),
  tryHard = c("no", "yes", "ordinal", "search"),
  optimizer = NULL
)

Arguments

name

The name of the model (defaults to "simplex")

selDVs

The BASENAMES of the variables i.e., c(obese), not c(obese_T1, obese_T2)

dzData

The DZ dataframe

mzData

The MZ dataframe

sep

The string preceding the final numeric twin identifier (often "_T") Combined with selDVs to form the full var names, i.e., just "dep" --> c("dep_T1", "dep_T2")

equateMeans

Whether to equate the means across twins (defaults to TRUE).

dzAr

The DZ genetic correlation (default = .5. Vary to examine assortative mating).

dzCr

The DZ "C" correlation (defaults = 1. To make an ADE model, set = .25).

addStd

Whether to add the algebras to compute a std model (default = TRUE).

addCI

Whether to add the interval requests for CIs (default = TRUE).

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

Value

Details

This code is beta quality: not for publication use. It will be completed by Boulder 2020.

The simplex model decomposes phenotypic variance into Additive genetic, unique environmental (E) and, optionally, either common or shared-environment (C) or non-additive genetic effects (D).

In the simplex model, these influences are modeled as a combination of:

  • Innovations at a given time (ai ci and ei matrices).

  • Influences transmitted from previous time (at, ct, and et matrices).

  • Influences specific to a single time (as, cs, es).

These combine to explain the causes of variance in the phenotype (see Figure).

Simplex path diagram:

Figure: simplex.png

Data Input Currently, the umxSimplex function accepts only raw data.

Ordinal Data In an important capability, the model transparently handles ordinal (binary or multi-level ordered factor data) inputs, and can handle mixtures of continuous, binary, and ordinal data in any combination.

Additional features The umxSimplex function supports varying the DZ genetic association (defaulting to .5) to allow exploring assortative mating effects, as well as varying the DZ “C” factor from 1 (the default for modeling family-level effects shared 100% by twins in a pair), to .25 to model dominance effects.

Matrices and Labels in the simplex model A good way to see which matrices are used in umxSummary is to run an example model and plot it.

The loadings specific to each time point are contained on the diagonals of matrices as, cs, and es. So labels relevant to modifying these are of the form "as_r1c1", "as_r2c2" etc.

All the shared matrices are in the model "top". So to see the 'as' values, you can simply execute:

m1$top$as$values

The transmitted loadings are in matrices at, ct, et.

The innovations are in the matrix ai, ci, and ei.

Less commonly-modified matrices are the mean matrix expMean. This has 1 row, and the columns are laid out for each variable for twin 1, followed by each variable for twin 2.

Thus, in a model where the means for twin 1 and twin 2 had been equated (set = to T1), you could make them independent again with this script:

m1$top$expMean$labels[1,4:6] = c("expMean_r1c4", "expMean_r1c5", "expMean_r1c6")

References

See Also

Other Twin Modeling Functions: plot.MxModelTwinMaker(), power.ACE.test(), umxACEcov(), umxACEv(), umxACE(), umxCP(), umxDoCp(), umxDoC(), umxGxE_window(), umxGxEbiv(), umxGxE(), umxIP(), umxRotate.MxModelCP(), umxSexLim(), umx

Examples

Run this code
# NOT RUN {
data(iqdat)
mzData = subset(iqdat, zygosity == "MZ")
dzData = subset(iqdat, zygosity == "DZ")
baseVars = c("IQ_age1", "IQ_age2", "IQ_age3", "IQ_age4")
m1= umxSimplex(selDVs= baseVars, dzData= dzData, mzData= mzData, sep= "_T", tryHard= "yes")

umxSummary(m1)
parameters(m1, patt = "^s")
m2 = umxModify(m1, regex = "as_r1c1", name = "no_as", comp = TRUE)
umxCompare(m1, m2)

# =============================
# = Test a 3 time-point model =
# =============================
m1 = umxSimplex(selDVs = paste0("IQ_age", 1:3), 
			dzData = dzData, mzData = mzData, sep = "_T", tryHard = "yes")
# }

Run the code above in your browser using DataLab