| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/robust-glmrob.R |
| 3 |
\name{augment.glmRob} |
| 4 |
\alias{augment.glmRob} |
| 5 |
\title{Augment data with information from a(n) glmRob object} |
| 6 |
\usage{ |
| 7 |
\method{augment}{glmRob}(x, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{Unused.} |
| 11 |
|
| 12 |
\item{...}{Unused.} |
| 13 |
} |
| 14 |
\description{ |
| 15 |
Augment accepts a model object and a dataset and adds |
| 16 |
information about each observation in the dataset. Most commonly, this |
| 17 |
includes predicted values in the \code{.fitted} column, residuals in the |
| 18 |
\code{.resid} column, and standard errors for the fitted values in a \code{.se.fit} |
| 19 |
column. New columns always begin with a \code{.} prefix to avoid overwriting |
| 20 |
columns in the original dataset. |
| 21 |
|
| 22 |
Users may pass data to augment via either the \code{data} argument or the |
| 23 |
\code{newdata} argument. If the user passes data to the \code{data} argument, |
| 24 |
it \strong{must} be exactly the data that was used to fit the model |
| 25 |
object. Pass datasets to \code{newdata} to augment data that was not used |
| 26 |
during model fitting. This still requires that at least all predictor |
| 27 |
variable columns used to fit the model are present. If the original outcome |
| 28 |
variable used to fit the model is not included in \code{newdata}, then no |
| 29 |
\code{.resid} column will be included in the output. |
| 30 |
|
| 31 |
Augment will often behave differently depending on whether \code{data} or |
| 32 |
\code{newdata} is given. This is because there is often information |
| 33 |
associated with training observations (such as influences or related) |
| 34 |
measures that is not meaningfully defined for new observations. |
| 35 |
|
| 36 |
For convenience, many augment methods provide default \code{data} arguments, |
| 37 |
so that \code{augment(fit)} will return the augmented training data. In these |
| 38 |
cases, augment tries to reconstruct the original data based on the model |
| 39 |
object with varying degrees of success. |
| 40 |
|
| 41 |
The augmented dataset is always returned as a \link[tibble:tibble]{tibble::tibble} with the |
| 42 |
\strong{same number of rows} as the passed dataset. This means that the passed |
| 43 |
data must be coercible to a tibble. If a predictor enters the model as part |
| 44 |
of a matrix of covariates, such as when the model formula uses |
| 45 |
\code{\link[splines:ns]{splines::ns()}}, \code{\link[stats:poly]{stats::poly()}}, or \code{\link[survival:Surv]{survival::Surv()}}, it is represented |
| 46 |
as a matrix column. |
| 47 |
|
| 48 |
We are in the process of defining behaviors for models fit with various |
| 49 |
\code{na.action} arguments, but make no guarantees about behavior when data is |
| 50 |
missing at this time. |
| 51 |
} |