Plot of LEGIT models. By default, variables that are not in G or E are fixed to the mean.
# S3 method for LEGIT
plot(
x,
cov_values = NULL,
gene_quant = c(0.025, 0.5, 0.975),
env_quant = c(0.025, 0.5, 0.975),
outcome_quant = c(0.025, 0.5, 0.975),
cols = c("#3288BD", "#CAB176", "#D53E4F"),
ylab = "Outcome",
xlab = "Environment",
legtitle = "Genetic score",
leglab = NULL,
xlim = NULL,
ylim = NULL,
x_at = NULL,
y_at = NULL,
cex.axis = 1.9,
cex.lab = 2,
cex.main = 2.2,
cex.leg = 2.2,
legend = "topleft",
...
)
Returns a list containing the different models (diathesis-stress, differential susceptibility and vantage sensitivity WEAK or STRONG) in order from best to worst for each selected criterion.
An object of class "LEGIT", usually, a result of a call to LEGIT.
Vector of the values, for each covariate, that will be used in the plotting, if there are any covariates. It must contain the names of the variables. Covariates are the variables that are not G nor E but still are adjusted for in the model. By default, covariates are fixed to the mean.
Vector of the genes quantiles used to make the plot. We use quantiles instead of fixed values because genetic scores can vary widely depending on the weights, thus looking at quantiles make this simpler. (Default = c(.025,.50,.975))
Vector of the environments quantiles used to make the plot. We use quantiles instead of fixed values because environmental scores can vary widely depending on the weights, thus looking at quantiles make this simpler. (Default = c(.025,.50,.975))
Vector of the outcome quantiles used to make the plot. We use quantiles instead of fixed values because environmental scores can vary widely depending on the weights, thus looking at quantiles make this simpler. (Default = c(.025,.50,.975))
Colors for the slopes with different genetic score. Must be a vector same length as "gene_range". (Default = c("#3288BD", "#CAB176", #D53E4F"))
Y-axis label (Default = "Outcome")
X-axis label (Default = "Environment")
Title of the Legend for the genes slopes label (Default = "Genetic score")
Optional vector of labels of the Legend for the genes slopes label
X-axis vector of size two with min and max (Default = NULL which leads to min="2.5 percentile" and max="97.5 percentile").
Y-axis vector of size two with min and max (Default = NULL which leads to min="2.5 percentile" and max="97.5 percentile").
specific ticks for the X-axis, first and last will be min and max respectively (Default = NULL which leads to 2.5, 50 and 97.5 percentiles).
specific ticks for the Y-axis, first and last will be min and max respectively (Default = NULL which leads to 2.5, 50 and 97.5 percentiles).
relative scale of axis (Default = 1.9)
relative scale of labels (Default = 2)
relative scale overall (Default = 2.2)
relative scale of legend (Default = 2.2)
The location may of the legend be specified by setting legend to a single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center" (Default = "topleft").
Further arguments passed to or from other methods.
Alexia Jolicoeur-Martineau, Ashley Wazana, Eszter Szekely, Meir Steiner, Alison S. Fleming, James L. Kennedy, Michael J. Meaney, Celia M.T. Greenwood and the MAVAN team. Alternating optimization for GxE modelling with weighted genetic and environmental scores: examples from the MAVAN study (2017). arXiv:1703.08111.
train = example_2way(500, 1, seed=777)
fit = LEGIT(train$data, train$G, train$E, y ~ G*E, train$coef_G, train$coef_E)
plot(fit)
Run the code above in your browser using DataLab