Learn R Programming

⚠️There's a newer version (1.4.1) of this package.Take me there.

LEGIT (version 1.3)

Latent Environmental & Genetic InTeraction (LEGIT) Model

Description

Constructs genotype x environment interaction (GxE) models where G is a weighted sum of genetic variants (genetic score) and E is a weighted sum of environments (environmental score) using the alternating optimization algorithm by Jolicoeur-Martineau et al. (2017) . This approach has greatly enhanced predictive power over traditional GxE models which include only a single genetic variant and a single environmental exposure. Although this approach was originally made for GxE modelling, it is flexible and does not require the use of genetic and environmental variables. It can also handle more than 2 latent variables (rather than just G and E) and 3-way interactions or more. The LEGIT model produces highly interpretable results and is very parameter-efficient thus it can even be used with small sample sizes (n < 250). Tools to determine the type of interaction (vantage sensitivity, diathesis-stress or differential susceptibility), with any number of genetic variants or environments, are available .

Copy Link

Version

Install

install.packages('LEGIT')

Monthly Downloads

233

Version

1.3

License

GPL-3

Maintainer

Alexia Jolicoeur-Martineau

Last Published

July 26th, 2019

Functions in LEGIT (1.3)

LEGIT

Latent Environmental & Genetic InTeraction (LEGIT) model
backward_step

Internal function that does the backward step for the stepwise IM function.
GxE_interaction_RoS

Regions of significance using Johnson-Neyman technique
backward_step_IM

Internal function that does the backward step for the stepwise IM function.
LEGIT_cv

Cross-validation for the LEGIT model
best_model

Best model
IMLEGIT_net

Independent Multiple Latent Environmental & Genetic InTeraction (IMLEGIT) model with Elastic Net on the latent variables. Do not use on it's own, use elastic_net_var_select instead.
IMLEGIT

Independent Multiple Latent Environmental & Genetic InTeraction (IMLEGIT) model
GxE_interaction_test

Testing of the GxE interaction
IMLEGIT_cv

Cross-validation for the IMLEGIT model
predict.IMLEGIT

Predictions of IMLEGIT fits
summary.IMLEGIT

Summarizing IMLEGIT fits
summary.LEGIT

Summarizing LEGIT fits
predict.LEGIT

Predictions of LEGIT fits
forward_step

Internal function that does the forward step for the stepwise function.
example_with_crossover

Simulated example of a 2 way interaction GxE model with crossover point.
stepwise_search_IM

Stepwise search for the best subset of elements in the latent variables with the IMLEGIT model
stepwise_search

Stepwise search for the best subset of genetic variants or environments with the LEGIT model
best_model.elastic_net_var_select

Best model from elastic net variable selection
rGE.LEGIT

Gene-Environment correlation estimation and testing of LEGIT models
bootstrap_var_select

Bootstrap variable selection (for IMLEGIT)
forward_step_IM

Internal function that does the forward step for the stepwise function.
genetic_var_select

Parallel genetic algorithm variable selection (for IMLEGIT)
example_3way

Simulated example of a 3 way interaction GxExz model
plot.LEGIT

Plot
plot.elastic_net_var_select

Plot function for the output of elastic_net_var_select
example_3way_3latent

Simulated example of a 3 way interaction GxExZ model
rGE

Gene-Environment correlation estimation and testing
rGE.IMLEGIT

Gene-Environment correlation estimation and testing of IMLEGIT models
r1nes_var_select

Parallel natural evolutionary variable selection assuming multivariate normal search distribution with a simple covariance matrix parametrization (for IMLEGIT)
summary.elastic_net_var_select

Summary function for the output of elastic_net_var_select
example_2way

Simulated example of a 2 way interaction GxE model.
nes_var_select

Parallel natural evolutionary variable selection assuming bernouilli distribution (for IMLEGIT)
longitudinal_folds

Longitudinal folds
elastic_net_var_select

Elastic net for variable selection in IMLEGIT model