batchLASSO: Batch LASSO

Description Usage Arguments Value Examples

View source: R/batchLASSO.R

Description

This function can be used to rank the response-exposure pairs from most to least "interesting". Simply using the resulting regression coefficients would be unwise, since the size of the coefficients cannot be compared from model to model. Instead, we use the tuning parameter, λ.

Each response variable in the given response matrix is regressed on all exposures in the matrix exposure. We determine for each exposure what the highest value of λ for which that variable is included for the first time in the regression model (i.e., its regression coefficient is non-zero). These λ-values can be compared across models.

Usage

1
batchLASSO(response, exposure, alpha = 1, verbose = TRUE)

Arguments

response

A binary matrix where each column is a response variable

exposure

A binary matrix where each column is an exposure

alpha

The elastic net mixing parameter (Default: 1.0 - LASSO)

verbose

Verbosity (Default: TRUE)

Value

A data frame with three columns

response

The response label (in case they are not given, they are simply numbered 1,2,3,...etc.)

exposure

The exposure label (in case they are not given, they are simply numbered 1,2,3,...etc.)

highest_lambda

The highest lambda for which the response-exposure pair where first added to the active set. The higher this value, the more "interesting" the pair

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
n <- 100 # no. of observations
r <- 5 # no. of response variables
e <- 10 # no. of exposures

# random response and exposure matrices
response <- matrix(rbinom(r*n, 1, 0.5), n, r)
exposure <- matrix(rbinom(e*n, 1, 0.5), n, e)

batchLASSO(response, exposure)

## End(Not run)

bips-hb/pvmcomparison documentation built on Dec. 13, 2020, 3:46 a.m.