Exercise

Using broom

Many programming tasks are easier if you keep all your data inside data frames. This is particularly true if you are a tidyverse fan, where dplyr and ggplot2 require you to use data frames. The broom package contains functions that decompose models into three data frames: one for the coefficient-level elements (the coefficients themselves, as well as p-values for each coefficient), the observation-level elements (like fitted values and residuals), and the model-level elements (mostly performance metrics).

The functions in broom are generic. That is, they work with many model types, not just linear regression model objects. They also work with logistic regression model objects (as you'll see in Chapter 4), and many other types of model.

mdl_price_vs_conv is available and broom is loaded.

Instructions 1/3

undefined XP
  • 1

    Tidy the model to print the coefficient-level elements of mdl_price_vs_conv.

  • 2

    Augment the model to print the observation-level elements of mdl_price_vs_conv.

  • 3

    Glance at the model to print the model-level elements of mdl_price_vs_conv.