lasso.ss {spselect}R Documentation

Spatial scale lasso

Description

This function fits a spatial scale (SS) lasso model.

Usage

lasso.ss(y, X, ss, a.lst, S.v, C.v, col.plot, verbose=TRUE, plot=TRUE)

Arguments

y

A numeric response vector

X

A data frame of numeric variables

ss

A vector of names to identify the different levels of covariates available as potential candidates for model input

a.lst

A list of identity matrices, where each column indicates a particular level or spatial scale for a specified covariate (e.g., ss1_x2)

S.v

A vector of positive integers, where each number denotes the number of spatial scales associated with a particular covariate

C.v

A vector, where all values are initialized to 0

col.plot

A vector of colors (corresponding to each SS) used in the coefficient path plot

verbose

If TRUE, details are printed as the algorithm progresses

plot

If TRUE, a coefficient path plot is generated

Details

This function estimates coefficients using the SS lasso modeling approach. The function also provides summary details and plots a coefficient path plot.

Value

A list with the following items:

beta

Regression coefficient estimates from all set of model solutions

beta.aic

Regression coefficient estimates from final model

ind.v

Vector of indices to denote the corresponding columns of X associated with each active predictor

aic.v

Vector of Akaike information criterion (AIC) values

stack.ss

Vector of indices to indicate the level at which each covariate enters the model

Author(s)

Lauren Grant, David Wheeler

References

Grant LP, Gennings C, Wheeler, DC. (2015). Selecting spatial scale of covariates in regression models of environmental exposures. Cancer Informatics, 14(S2), 81-96. doi: 10.4137/CIN.S17302

Examples

data(y)
data(X)

names.X <- colnames(X)

ss <- c("ind", "ss1", "ss2")

a.lst <- list(NULL)
a.lst[[1]] <- 1
dim(a.lst[[1]]) <- c(1,1)
dimnames(a.lst[[1]]) <- list(NULL, names.X[1])

a.lst[[2]] <- diag(2)
dimnames(a.lst[[2]]) <- list(NULL, names.X[c(2,3)])

a.lst[[3]] <- diag(2)
dimnames(a.lst[[3]]) <- list(NULL, names.X[c(4,5)])

S.v <- c(1,2,2)
C.v <- rep(0,length(a.lst))

mod_lasso.ss <- lasso.ss(y, X, ss, a.lst, S.v, C.v, c("black", "red", "green"))

[Package spselect version 0.0.1 Index]