B.3 The augment() function

The augment() function is another useful function in broom. The important distinction between this function and the two other ones from broom is that augment() returns information on each observation or datapoint, whereas glance() returns additional information on the whole model.

B.3.1 Chi-square tests

Using augment() on a chi-square object will print out a dataframe containing both the expected and the observed proportions for each cell.

augment(properties_chisq)

B.3.2 Regressions

augment() is probably most useful for regression models. It will print out the following:

  • .fitted is the predicted score for each participant
  • .resid is the residual for each participant (i.e. actual - fitted)
  • .cooksd is Cook’s distance, which is useful for outlier detection in some contexts
augment(marketing_lm)