CommencerCommencer gratuitement

Eliminating predictors

You technically still do not know which predictors are really required in the model. Again, you use the function stepAIC() from the add-on package MASS to exclude unnecessary predictors. The argument direction = "backward" starts the selection process with the extended.model and sequentially removes terms in an effort to lower the AIC. The argument trace = FALSE suppresses information to be printed during the running of the selection process. You summarize the final model, resulting in the minimum AIC value, by the function summary().

Cet exercice fait partie du cours

Building Response Models in R

Afficher le cours

Instructions

  • Perform backward selection of predictors on the extended.model object by using the function stepAIC(). Assign the result to an object named final.model.
  • Summarize the final.model object by using the function summary().

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Backward elemination
final.model <- ___(___, direction = ___, trace = ___)

# Summarize the final.model
Modifier et exécuter le code