broom (version 0.5.4)

augment.glm: Augment a(n) glm object

Description

This augment method wraps augment.lm().

Usage

# S3 method for glm
augment(x, ...)

Arguments

x

A glm object returned from stats::glm().

...

Arguments passed on to augment.lm

data

A data.frame() or tibble::tibble() containing the original data that was used to produce the object x. Defaults to stats::model.frame(x) so that augment(my_fit) returns the augmented original data. Do not pass new data to the data argument. Augment will report information such as influence and cooks distance for data passed to the data argument. These measures are only defined for the original training data.

newdata

A data.frame() or tibble::tibble() containing all the original predictors used to create x. Defaults to NULL, indicating that nothing has been passed to newdata. If newdata is specified, the data argument will be ignored.

type.predict

Type of predictions to use when x is a glm object. Passed to stats::predict.glm().

type.residuals

Type of residuals to use when x is a glm object. Passed to stats::residuals.glm().

Value

When newdata is not supplied augment.lm returns one row for each observation, with seven columns added to the original data:

.hat

Diagonal of the hat matrix

.sigma

Estimate of residual standard deviation when corresponding observation is dropped from model

.cooksd

Cooks distance, cooks.distance()

.fitted

Fitted values of model

.se.fit

Standard errors of fitted values

.resid

Residuals

.std.resid

Standardised residuals

Some unusual lm objects, such as rlm from MASS, may omit .cooksd and .std.resid. gam from mgcv omits .sigma.

When newdata is supplied, returns one row for each observation, with three columns added to the new data:

.fitted

Fitted values of model

.se.fit

Standard errors of fitted values

.resid

Residuals of fitted values on the new data

See Also

augment(), augment.lm()

stats::glm()

Other lm tidiers: augment.lm(), glance.glm(), glance.lm(), tidy.glm(), tidy.lm()