Session Ready
Exercise

What's the value added?

You still remember the bad performance of your first simple response model. Now, you are getting curious about the value added by taking lags. Therefore, you combine all the marketing tools and their lagged-effects in one model named extended.model. You obtain the model predictions by using the function fitted.values() on the extended.model object. To account for the loss of the first observation due to the lag operation you append NA to the vector of predicted values.

This time, to check your model, you display the relation between log(SALES) and the running index by using plot(). Likewise, you add the model predictions to the graph by using lines(). The lines() function joins the predicted data points and the running index using line segments.

Instructions
100 XP
  • Estimate an extended response model explaining log(SALES) by all marketing tools and their lagged terms. Assign the result to an object named extended.model.
  • Obtain the model predictions by using the function fitted.values() on the extended.model object. Assign the result to an object named predicted.values.
  • Display the relation between log(SALES) and the running index by using the function plot().
  • Add the model predictions to the graph by using the function lines().