stepaic: Stepwise forward variable selection based on the AIC...

Description Usage Arguments Value See Also Examples

View source: R/add.r

Description

It is a wrapper function over the step function in the buildin package stats

Usage

1
stepaic(Data, standardize = TRUE)

Arguments

Data

a data frame, as a first column should hava the response variable y

standardize

Logical flag for x variable standardization, prior to fitting the model sequence. Default is standardize=TRUE

Value

a list with the coefficients of the final model. It also returns the in-sample AUC and the Brier score

See Also

step

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
set.seed(14)
beta    <- c(3, 2, -1.6, -4)
noise   <- 5
simData <- SimData(N=100, beta=beta, noise=noise, corr=FALSE)

stepaicfit <- stepaic(Data=simData)
stepaicfit

## End(Not run)

Example output

$coefaic
       X4        X1        X2        X3 
-4.468434  3.166029  2.661629 -1.272974 

$aucstepaicTr

Call:
roc.default(response = Data[, 1], predictor = c(Xbstepaic))

Data: c(Xbstepaic) in 40 controls (Data[, 1] 0) < 60 cases (Data[, 1] 1).
Area under the curve: 0.9738

$brierstepaic
[1] 0.06489562

stepPenal documentation built on May 1, 2019, 10:11 p.m.

Related to stepaic in stepPenal...