Learn R Programming

sail: Sparse Additive Interaction Learning

R software package to fit sparse additive interaction models with the strong heredity property. Interactions are limited to a single exposure or environment variable. The following figure (based on simulated data) gives an idea of the situation our method is trying to capture:

The x-axis is a predictor, the y-axis is the response and each line represents an exposure status. In this example, we see that the effect of the DNA methylation (at one CpG site) on obesity is linear for controls (unexposed: E=0) and non-linear for individuals with a gestational diabetes-affected pregnancy (exposed: E=1).

Installation

You can install the development version of sail from GitHub with:

if (!require("pacman")) install.packages("pacman")
pacman::p_install_gh("sahirbhatnagar/sail")

Vignette

See the online vignette for details about the sail model and example usage of the functions.

Model Input

This method requires four inputs (let n be the number of observations and p the number of X variables):

  1. X: n x p matrix of covariates. Can be high-dimensional, i.e., p >> n. Can also be continuous, categorical or a combination of both.
  2. Y: a continuous response of length n
  3. E: an exposure variable of length n. Can be continuous or categorical.
  4. A basis expansion function f(X_j) to be applied to each column of X, for example
f.basis <- function(x) splines::bs(x, degree = 5)

Model Output

The sail method will search for all main effects and interactions between E and f(X_j) that are associated with the response Y, in a multivariable regression model. It will perform simultaneous variable selection and estimation of model parameters, and return a sparse model (i.e. many parameters with coefficient 0).

Credit

We make use of the following packages:

Related Work

Contact

Latest news

You can see the most recent changes to the package in the NEWS.md file

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Copy Link

Version

Install

install.packages('sail')

Monthly Downloads

15

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Last Published

December 13th, 2019

Functions in sail (0.1.0)

design_sail

Sail design matrix
gendata

Simulation Scenario from Bhatnagar et al. (2018+) sail paper
cv.lspath

Compute cross validation error
plot.cv.sail

Plot the cross-validation curve produced by cv.sail
gendataPaper

Simulation Scenario from Bhatnagar et al. (2018+) sail paper
oasis

OASIS Brain Data
plotInter

Plot Interaction Effects from sail object
plotMain

Plot Estimated Component Smooth Functions for Main Effects
sail-internal

Internal sail functions
print.sail

Print Method for sail object
createfolds

Create CV Folds
sail

Fit Sparse Additive Interaction Model with Strong Heredity
Q_theta

Objective function
sailsim

Simulated Data Used in Bhatnagar et al. (2018+) Paper
cv.sail

Cross-validation for sail
standardize

Standardize Data
plot.sail

Plot Method for sail object
predict.cv.sail

Make predictions from a cv.sail object
predict.sail

Make predictions from a sail object