Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umxPlotGxE

Plot the results of a GxE univariate test for moderation of ACE components.


Description

Plot GxE results (univariate environmental moderation of ACE components). Options include plotting the raw and standardized graphs separately, or in a combined panel. You can also set the label for the x axis (xlab), and choose the location of the legend.

Usage

umxPlotGxE(
  x,
  xlab = NA,
  location = "topleft",
  separateGraphs = FALSE,
  acergb = c("red", "green", "blue", "black"),
  gg = TRUE,
  moderatorValues = NULL,
  ...
)

Arguments

x

A fitted umxGxE() model to plot

xlab

String to use for the x label (default = NA, which will use the variable name)

location

Where to plot the legend (default = "topleft") see ?legend for alternatives like bottomright

separateGraphs

(default = FALSE)

acergb

Colors to use for plot c(a = "red", c = "green", e = "blue", tot = "black")

gg

Use ggplot2 (default = TRUE)

moderatorValues

If you want to pass in your own list of moderator values instead of the real ones in the data (Default = NULL)

...

Optional additional parameters

Details

note: If gg=TRUE, the plots are drawn in ggplot, and also returned as a list(raw, std) so you can edit them.

Value

None

References

See Also

Examples

## Not run: 
require(umx)
data(twinData)
twinData$age1 = twinData$age2 = twinData$age
mzData = subset(twinData, zygosity == "MZFF")
dzData = subset(twinData, zygosity == "DZFF")
m1= umxGxE(selDVs= "bmi", selDefs= "age", dzData= dzData, mzData= mzData, sep="", tryHard="yes")
plot(m1)
# Directly call umxPlotGxE
umxPlotGxE(m1, xlab = "Age", separateGraphs = TRUE, gg = FALSE)
umxPlotGxE(m1, moderatorValues=18:67)


## End(Not run)

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.