Many complex diseases are known to be affected by the interactions between genetic variants and environmental exposures beyond the main genetic and environmental effects. Existing Bayesian methods for G×E interaction studies are challenged by the high-dimensional nature of the study and the complexity of environmental influences. We have developed a novel and powerful semi-parametric Bayesian variable selection method that can accommodate linear and nonlinear G×E interactions simultaneously. Furthermore, the proposed method can conduct structural identification by distinguishing nonlinear interactions from main effects only case within Bayesian framework. Spike-and-slab priors are incorporated on both individual and group level to shrink coefficients corresponding to irrelevant main and interaction effects to zero exactly. The MCMC algorithms of the proposed and alternative methods are efficiently implemented in C++.

- To install from github, run these two lines of code in R

```
install.packages("devtools")
devtools::install_github("jrhub/spinBayes")
```

```
library(spinBayes)
data(gExp.L)
test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,])
spbayes
selected = BVSelection(spbayes)
selected
pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)
```

```
data(gExp.L)
test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,], structural=FALSE)
spbayes
selected = BVSelection(spbayes)
selected
pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)
```

```
data(gExp.L)
test = sample((1:nrow(X2)), floor(nrow(X2)/5))
spbayes=BVCfit(X2[-test,], Y2[-test,], Z2[-test,], E2[-test,], clin2[-test,], structural=TRUE, sparse=FALSE)
spbayes
selected = BVSelection(spbayes)
selected
pred = predict(spbayes, X2[test,], Z2[test,], E2[test,], clin2[test,], Y2[test,])
pred$pmse
# c(pred$y.pred)
```

This package provides implementation for methods proposed in

- Ren, J., Zhou, F., Li, X., Chen, Q., Zhang, H., Ma, S., Jiang, Y., Wu, C. (2019) Semi-parametric Bayesian variable selection for gene-environment interactions. arXiv:1906.01057

**Any scripts or data that you put into this service are public.**

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.