Description Usage Arguments Details Value Author(s) References Examples
This function fits a spatial scale (SS) forward stepwise regression model.
1 | stepwise.ss(y, X.3D, y.name, ss, epsilon, verbose=TRUE)
|
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 |
This function estimates coefficients using the SS forward stepwise regression approach. The function also estimates the model fit and provides summary details.
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 |
Lauren Grant, David Wheeler
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
1 2 3 4 5 |
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] "Results are with no intercept."
[1] "Start: AIC = -1.0259"
[1] "y ~ 0"
[1] 1
[1] "Step: AIC = -10.3344"
[1] "y ~ ss1_x2.ss1"
[1] 2
[1] "Step: AIC = -13.6769"
y ~ ss1_x2.ss1 + ind_x1.ind
[1] "Diff in AIC = 3.3425"
[1] 3
[1] "Step: AIC = -22.6657"
y ~ ss1_x2.ss1 + ind_x1.ind + ss2_x3.ss2
[1] "Diff in AIC = 8.9887"
Call:
lm(formula = y ~ . - 1, data = X.in, x = TRUE, y = TRUE)
Coefficients:
ss1_x2.ss1 ind_x1.ind ss2_x3.ss2
0.6784 0.4703 0.4443
[1] "Diff in AIC = 8.9887"
[1] "Epsilon = 1"
[1] "No. of vars in model = 3"
[1] "Total no. of vars possible = 3"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.