An R package for the Latent Environmental & Genetic InTeraction (LEGIT) model
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
build
images
inst/doc
man
vignettes
.gitattributes
DESCRIPTION
LICENSE
NAMESPACE
NEWS
README.md

README.md

LEGIT

This is a R implementation of the Latent Environmental & Genetic InTeraction (LEGIT) model.

Description

The LEGIT model is an interaction model with two latent variables: a weighted sum of genetic variants (genetic score) and a weighted sum of environmental variables (environmental score). Alternating optimization is used to estimate the model parameters (https://arxiv.org/abs/1703.08111). 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 (https://psyarxiv.com/27uw8).

How to use

A vignette explaining how to use the software is available here : https://rawgit.com/AlexiaJM/LEGIT/master/inst/doc/LEGIT.html

An additional vignette explaining how it can be used for GxE testing as per Belsky et al. (2013) is available here: https://rawgit.com/AlexiaJM/LEGIT/master/inst/doc/GxE_testing.html

How to install

To install the latest stable version, run in R :

  • install.packages("LEGIT")

To install the latest GitHub development version which could contain new or experimental features, run in R :

  • install.packages("devtools")
  • devtools::install_github("AlexiaJM/LEGIT")

Examples

Here is an example with 2 latent variables and a 2-way interaction (see https://arxiv.org/abs/1703.08111) :

Here is an example with 3 latent variables and a 3-way interaction (see https://arxiv.org/abs/1703.08111) :

References