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
Returns
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:
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.
Note
Plots are also available. A tabular represents the selected terms for each value in P.
The evolution of the R2 criterion, the evolution of the size m of the selected model and criteria on the test set or by K-folds cross-validation are represented.
These graphical tools can be used to select the best value for the penalty parameter.