MulaiMulai sekarang secara gratis

Eliminating predictors

You do not want to exclude the lagged coupon effect yet. The company needs a really sound model to improve it's future marketing decisions and to effectively run their campaign. To be 100% sure, you perform backward selection of predictors by using the function stepAIC(), loaded from the add-on package MASS.

The stepAIC() function builds all possible combinations of predictors and determines which has the lowest AIC. 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. The final model, resulting in the minimum AIC value, is summarized by the function summary().

Latihan ini adalah bagian dari kursus

Building Response Models in R

Lihat Kursus

Petunjuk latihan

  • Load the add-on package MASS by using the function library().
  • Perform backward elimination 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().

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Load the MASS package


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

# Summarize the final model
Edit dan Jalankan Kode