Constructs a LEGIT model and returns the regions of significance (RoS) with the predicted type of interaction (diathesis-stress, vantage-sensitivity, or differential susceptibility). RoS is not recommended due to poor accuracy with small samples and small effect sizes, GxE_interaction_test has much better accuracy overall. Only implemented for family=gaussian.
GxE_interaction_RoS(
data,
genes,
env,
formula_noGxE,
t_alpha = 0.05,
start_genes = NULL,
start_env = NULL,
eps = 0.001,
maxiter = 100,
ylim = NULL,
reverse_code = FALSE,
rescale = FALSE
)
Returns a list containing the RoS and the predicted type of interaction.
data.frame of the dataset to be used.
data.frame of the variables inside the genetic score G (can be any sort of variable, doesn't even have to be genetic).
data.frame of the variables inside the environmental score E (can be any sort of variable, doesn't even have to be environmental).
formula WITHOUT G or E (y ~ covariates). G and E will automatically be added.
Alpha level of the student-t distribution for the regions of significance (Default = .05)
Optional starting points for genetic score (must be the same length as the number of columns of genes
).
Optional starting points for environmental score (must be the same length as the number of columns of env
).
Threshold for convergence (.01 for quick batch simulations, .0001 for accurate results).
Maximum number of iterations.
Optional vector containing the known min and max of the outcome variable. Even if your outcome is known to be in [a,b], if you assume a Gaussian distribution, predict() could return values outside this range. This parameter ensures that this never happens. This is not necessary with a distribution that already assumes the proper range (ex: [0,1] with binomial distribution).
If TRUE, after fitting the model, the genes with negative weights are reverse coded (ex: \(g_rev\) = 1 - \(g\)). It assumes that the original coding is in [0,1]. The purpose of this option is to prevent genes with negative weights which cause interpretation problems (ex: depression normally decreases attention but with a negative genetic score, it increases attention). Warning, using this option with GxG interactions could cause nonsensical results since GxG could be inverted. Also note that this may fail with certain models (Default=FALSE).
If TRUE, the environmental variables are automatically rescaled to the range [-1,1]. This improves interpretability (Default=FALSE).
Alexia Jolicoeur-Martineau, Jay Belsky, Eszter Szekely, Keith F. Widaman, Michael Pluess, Celia Greenwood and Ashley Wazana. Distinguishing differential susceptibility, diathesis-stress and vantage sensitivity: beyond the single gene and environment model (2017). https://osf.io/preprints/psyarxiv/27uw8. 10.17605/OSF.IO/27UW8.
Daniel J. Bauer & Patrick J. Curran. Probing Interactions in Fixed and Multilevel Regression: Inferential and Graphical Techniques (2005). Multivariate Behavioral Research, 40:3, 373-400, DOI: 10.1207/s15327906mbr4003_5.
train = example_2way(500, 1, seed=777)
ros = GxE_interaction_RoS(train$data, train$G, train$E, y ~ 1)
ros
Run the code above in your browser using DataLab