Aan de slagGa gratis aan de slag

Dropping predictors

To obtain support for your decision, you compare the model fit of the maximal model to the model excluding the lagged coupon effect by its AIC.

You can get the AIC value by using the function AIC() on the corresponding model object. This is easy for the maximal model which is given by the extended.model object. To get the AIC value for the model excluding Coupon.lag you first need to apply the function update() on the extended.model object. In addition to updating a model for the inclusion of an additional predictor, you can also drop a predictor. You just need to put a minus sign in front of corresponding predictor.

Deze oefening maakt deel uit van de cursus

Building Response Models in R

Cursus bekijken

Oefeninstructies

  • Get the AIC value for the extended.model object by using the function AIC().
  • Update the extended.model object by dropping Coupon.lag using the function update(). Get the AIC for the updated model by using the function AIC().

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Obtain the AIC
___(extended.model)

# Update the AIC by single term deletion
___(___(extended.model, . ~ . ___))
Code bewerken en uitvoeren