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.
B.3.2 Regressions
augment() is probably most useful for regression models. It will print out the following:
.fittedis the predicted score for each participant.residis the residual for each participant (i.e. actual - fitted).cooksdis Cook’s distance, which is useful for outlier detection in some contexts