GxE_interaction_RoS {LEGIT} | R Documentation |
Regions of significance using Johnson-Neyman technique
Description
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.
Usage
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
)
Arguments
data |
data.frame of the dataset to be used. |
genes |
data.frame of the variables inside the genetic score G (can be any sort of variable, doesn't even have to be genetic). |
env |
data.frame of the variables inside the environmental score E (can be any sort of variable, doesn't even have to be environmental). |
formula_noGxE |
formula WITHOUT G or E (y ~ covariates). G and E will automatically be added. |
t_alpha |
Alpha level of the student-t distribution for the regions of significance (Default = .05) |
start_genes |
Optional starting points for genetic score (must be the same length as the number of columns of |
start_env |
Optional starting points for environmental score (must be the same length as the number of columns of |
eps |
Threshold for convergence (.01 for quick batch simulations, .0001 for accurate results). |
maxiter |
Maximum number of iterations. |
ylim |
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). |
reverse_code |
If TRUE, after fitting the model, the genes with negative weights are reverse coded (ex: |
rescale |
If TRUE, the environmental variables are automatically rescaled to the range [-1,1]. This improves interpretability (Default=FALSE). |
Value
Returns a list containing the RoS and the predicted type of interaction.
References
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.
Examples
train = example_2way(500, 1, seed=777)
ros = GxE_interaction_RoS(train$data, train$G, train$E, y ~ 1)
ros