Introduction to the Elja package

Marwan EL HOMSI

library(Elja)

Environment-Wide Association Studies (EWAS) are the study of the association between a health event and several exposures one after the other. With this package, it is possible to carry out an EWAS analysis in the simplest way and to display easily interpretable results in the output.

To do this, you must first define several points:

The Elja package works step by step to perform an EWAS analysis:

This document introduces the basic use of this package in an EWAS analysis.

Data: SynthDiabetes

In order to show in a simple way the use of the Elja package, we will use a synthetic diabetes dataset mimicking the original PIMA data. This dataset is present in the package mlbench (https://CRAN.R-project.org/package=mlbench).

library(mlbench)
data(SynthDiabetes)
head(SynthDiabetes)
#>   pregnant glucose pressure triceps insulin mass pedigree age diabetes
#> 1        0     194       50      45       0 28.5    0.240  28      neg
#> 2        8     129       84       0       0 27.6    0.828  44      pos
#> 3        2     132       72      42       0 38.2    0.696  26      neg
#> 4        6     184       62       0       0 24.7    0.192  39      neg
#> 5        4     108       58      32       0 31.6    0.178  22      neg
#> 6       10     117       80      13       0 30.1    0.383  58      pos

This dataset containing a health event (diabetes) will allow us to to illustrate the functioning of the Elja package.

Preparation of the data set

Before performing the function, we have to make sure that the dataset is well structured.

To do so, we have to check 2 elements:


str(SynthDiabetes)
#> 'data.frame':    768 obs. of  9 variables:
#>  $ pregnant: num  0 8 2 6 4 10 3 1 4 7 ...
#>  $ glucose : num  194 129 132 184 108 117 100 88 73 126 ...
#>  $ pressure: num  50 84 72 62 58 80 80 75 82 92 ...
#>  $ triceps : num  45 0 42 0 32 13 41 30 38 0 ...
#>  $ insulin : num  0 0 0 0 0 0 65 49 0 0 ...
#>  $ mass    : num  28.5 27.6 38.2 24.7 31.6 30.1 46.3 32.4 44.2 37.3 ...
#>  $ pedigree: num  0.24 0.828 0.696 0.192 0.178 0.383 2.42 0.447 0.56 0.66 ...
#>  $ age     : num  28 44 26 39 22 58 33 22 33 46 ...
#>  $ diabetes: Factor w/ 2 levels "neg","pos": 1 2 1 1 1 2 2 1 1 2 ...

Diabetes, which is our target health event, stands alone with exposures. In addition, the variables all have the correct class associated.

Determine the type of model you want to use

According to the class of the outcome, one model will be preferred to another. It is therefore necessary to choose the right model for the type of variable chosen as the health event.

We have seen previously that our health event is binary categorical: Diabetes (Yes/No).

str(SynthDiabetes$diabetes)
#>  Factor w/ 2 levels "neg","pos": 1 2 1 1 1 2 2 1 1 2 ...

We can therefore use a logistic regression model.

Use of the ELJAlogistic function

The approach for the logistic regression is similar for the models linear models with ELJAlinear function and for Generalized Linear Models with ELJAglm function.

The dataset being prepared and the type of model chosen, we can proceed to the analysis.

To do so, the following information are needed:

Other information can be added to the output of the function:


ELJAlogistic(var = 'diabetes',data = SynthDiabetes,manplot = TRUE,
             Bonferroni = TRUE,FDR = TRUE, nbvalmanplot = 30, manplotsign = FALSE)

results
#>                      level odd_ratio    ci_low  ci_high      p_value   n
#> pregnant_pregnant pregnant  1.111290 1.0698148 1.155038 6.560785e-08 768
#> glucose_glucose    glucose  1.036122 1.0301686 1.042435 5.887245e-32 768
#> pressure_pressure pressure  1.005326 0.9975526 1.013514 1.880931e-01 768
#> triceps_triceps    triceps  1.002934 0.9937929 1.012174 5.305944e-01 768
#> insulin_insulin    insulin  1.002320 1.0010665 1.003610 3.287524e-04 768
#> mass_mass             mass  1.052565 1.0319202 1.074548 6.836699e-07 768
#> pedigree_pedigree pedigree  1.962055 1.3043658 2.981537 1.342156e-03 768
#> age_age                age  1.037159 1.0243860 1.050386 1.100871e-08 768
#>                         AIC
#> pregnant_pregnant  981.7257
#> glucose_glucose    828.7484
#> pressure_pressure 1009.8510
#> triceps_triceps   1011.2376
#> insulin_insulin    998.3846
#> mass_mass          984.4242
#> pedigree_pedigree 1001.1303
#> age_age            977.6466

We observe a Manhattan plot showing the results of the EWAS analysis and a dataframe showing the more detailed results.

References