This augment method wraps augment.lm().

# S3 method for glm
augment(x, data = stats::model.frame(x), newdata = NULL,
  type.predict, type.residuals, ...)

Arguments

x

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

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().

...

Additional arguments. Not used. Needed to match generic signature only. Cautionary note: Misspelled arguments will be absorbed in ..., where they will be ignored. If the misspelled argument has a default value, the default value will be used. For example, if you pass conf.lvel = 0.9, all computation will proceed using conf.level = 0.95. Additionally, if you pass newdata = my_tibble to an augment() method that does not accept a newdata argument, it will use the default value for the data argument.

Details

Note that if the weights for any of the observations in the model are 0, then columns ".infl" and ".hat" in the result will be 0 for those observations.

See also