stagewise.ss: Spatial scale incremental forward stagewise regression

Description Usage Arguments Details Value Author(s) References Examples

View source: R/stagewise.ss.R

Description

This function fits a spatial scale (SS) incremental forward stagewise regression model.

Usage

1
stagewise.ss(y, X, X.3D, ss, increment, tolerance, col.plot, verbose=TRUE, plot=TRUE)

Arguments

y

A numeric response vector

X

A data frame of numeric variables

X.3D

A 3-D or stacked array of numeric variables, where each stack represents a particular level of covariates (i.e., individual- and area-level variables at more than one spatial scale). In cases where values are only present for a covariate at certain levels, that covariate is assigned missing values at all other levels.

ss

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

increment

A positive step size

tolerance

A small, positive value used as a stopping criterion when none of the predictors are correlated with the residuals. The algorithm stops if the overall maximum correlation is less than a specified tolerance.

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 forward stagewise regression approach. The function also provides summary details and plots a coefficient path plot.

Value

A list with the following items:

beta.final

Regression coefficient estimates from final model

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

1
2
3
4
5
data(y)
data(X)
data(X.3D)
ss <- c("ind", "ss1", "ss2")
mod_forward.stage.ss_0.1 <- stagewise.ss(y, X ,X.3D, ss, 0.1, 0.1, c("black", "red", "green"))

Example output

Loading required package: tester
Loading required package: magic
Loading required package: abind
Loading required package: pracma

Attaching package: 'pracma'

The following object is masked from 'package:magic':

    magic

[1] "Iteration = 16"
[1] "Max|cor| = 0.096"
[1] "Tolerance = 0.1"
    x1 ss1_x2 ss2_x3 
   0.5    0.7    0.4 
[1] "No. of vars in model = 3"
[1] "Total no. of vars possible = 3"
[1] "Increment = 0.1, Tolerance = 0.1"

spselect documentation built on May 2, 2019, 3:32 a.m.