Learn R Programming

DiceEval (version 1.4)

stepEvolution: Evolution of the stepwise model

Description

Graphical representation of the selected terms using stepwise procedure for different values of the penalty parameter.

Usage

stepEvolution(X,Y,formula,P=1:7,K=10,test=NULL,graphic=TRUE)

Arguments

X

a data.frame containing the design of experiments

Y

a vector containing the response variable

formula

a formula for the initial model

P

a vector containing different values of the penalty parameter for which a stepwise selected model is fitted

K

the number of folds for the cross-validation procedure

test

an additional data set on which the prediction criteria are evaluated (default corresponds to no test data set)

graphic

if TRUE the values of the criteria are represented

Value

a list with the different criteria for different values of the penalty parameter. This list contains:

penalty

the values for the penalty parameter

m

size m of the selected model for each value in P

R2

the value of the R2 criterion for each model

According to the value of the test argument, other criteria are calculated: ll a. If a test set is available, R2test contains the value of the R2 criterion on the test set b. If no test set is available, the Q2 and the RMSE computed by cross-validation are done.

See Also

step procedure for linear models.

Examples

Run this code
# NOT RUN {
data(dataIRSN5D)
design <- dataIRSN5D[,1:5]
Y	   <- dataIRSN5D[,6]
out	   <- stepEvolution(design,Y,formulaLm(design,Y),P=c(1,2,5,10,20,30))
# }

Run the code above in your browser using DataLab