The vennLasso package provides methods for hierarchical variable selection for models with covariate effects stratified by multiple binary factors.

Installation and Help Files

The vennLasso package can be installed from CRAN using:

The development version can be installed using the devtools package:

devtools::install_github("jaredhuling/vennLasso")

or by cloning and building.

Load the vennLasso package:

Access help file for the main fitting function vennLasso() by running:

Help file for cross validation function cv.vennLasso() can be accessed by running:

A Quick Example

Simulate heterogeneous data:

Inspect the populations for each strata:

Fit vennLasso model with tuning parameter selected with 5-fold cross validation:

Plot selected variables for each strata (not run):

## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
plotSelections(fit.adapt)

Predict response for test data:

Evaluate mean squared error:

## [1] 0.6852124
## [1] 1.011026

Compare with naive model with all interactions between covariates and stratifying binary factors:

Fit linear model and generate predictions for test set:

Evaluate mean squared error:

## [1] 0.8056107
## [1] 0.6852124