stepwise.ss {spselect} | R Documentation |
Spatial scale forward stepwise regression
Description
This function fits a spatial scale (SS) forward stepwise regression model.
Usage
stepwise.ss(y, X.3D, y.name, ss, epsilon, verbose=TRUE)
Arguments
y |
A numeric response vector |
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. |
y.name |
A name for y |
ss |
A vector of names to identify the different levels of covariates available as potential candidates for model input |
epsilon |
A positive value used as a stopping criterion when there is inadequate improvement in the model's performance. The algorithm stops if the difference in the Akaike information criterion (AIC) between the current model and the proposed model is less than epsilon. |
verbose |
If TRUE, details are printed as the algorithm progresses |
Details
This function estimates coefficients using the SS forward stepwise regression approach. The function also estimates the model fit and provides summary details.
Value
A list with the following items:
beta.final |
Regression coefficient estimates from final model |
aic.final |
AIC for final model |
summary.final |
Summary output of 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
data(y)
data(X.3D)
y.name <- "y"
ss <- c("ind", "ss1", "ss2")
mod_forward.step.ss_1 <- stepwise.ss(y, X.3D, y.name, ss, 1)