6.2 Use Model results

Now that we have a fitted model we will need to pull some summary information from it we will use two extremely fun functions from the {broom} package to help us out (tidy() & glance()).

  • tidy() - Has a bunch of versatility, but for our context it can take our model object and return our model coefficients into a nice tibble.
broom::tidy(lm_form_fit) %>% 
  knitr::kable()
term estimate std.error statistic p.value
(Intercept) -300.250929 14.5815154 -20.59120 0
Longitude -2.013412 0.1296788 -15.52615 0
Latitude 2.781713 0.1816642 15.31239 0


  • glance() - allows us in this context to convert our model’s summary statistics into a tibble
broom::glance(lm_form_fit) %>% 
  knitr::kable()
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC deviance df.residual nobs
0.1639281 0.1632132 0.1613844 229.3031 0 2 950.0754 -1892.151 -1869.116 60.91909 2339 2342