| augment.mixpoissonreg {mixpoissonreg} | R Documentation |
Augment data with information from a mixpoissonreg object
Description
Augment accepts a model object and a dataset and adds information about each observation in the dataset. It includes
predicted values in the .fitted column, residuals in the .resid column, and standard errors for the fitted values in a .se.fit column, if
the type of prediction is 'link'. New columns always begin with a . prefix to avoid overwriting columns in the original dataset.
Usage
## S3 method for class 'mixpoissonreg'
augment(
x,
data = stats::model.frame(x),
newdata = NULL,
type.predict = c("response", "link", "precision", "variance"),
type.residuals = c("pearson", "score"),
se_fit = FALSE,
conf_int = TRUE,
pred_int = FALSE,
...
)
Arguments
x |
A |
data |
A |
newdata |
A |
type.predict |
Type of prediction. The options are 'response', 'link', 'precision' and 'variance'. The default is "response". |
type.residuals |
Type of residuals. The options are 'pearson' and 'score'. The default is 'pearson'. |
se_fit |
Logical indicating whether or not a .se.fit column should be added to the augmented output. If TRUE, it only returns a non-NA value if type of prediction is 'link'. |
conf_int |
Logical indicating whether or not confidence intervals for the fitted variable with type chosen from type.predict should be built. The available type options are 'response' and 'link'. |
pred_int |
Logical indicating whether or not prediction intervals for future observations should be built. It only works with type.predict = 'response'. The arguments
|
... |
Additional arguments. Possible additional arguments are |
Value
A tibble::tibble() with columns:
-
.cooksdCook's distance. -
.fittedFitted or predicted value. -
.fittedlwrconfLower bound of the confidence interval, if conf_int = TRUE -
.fitteduprconfUpper bound of the confidence interval, if conf_int = TRUE -
.fittedlwrpredLower bound of the prediction interval, if pred_int = TRUE -
.fitteduprpredUpper bound of the prediction interval, if pred_int = TRUE -
.hatDiagonal of the hat matrix. -
.residThe chosen residual. -
.resfitThe chosen residual of the fitted object. -
.se.fitStandard errors of fitted values, if se_fit = TRUE. -
.gencooksdGeneralized Cook's distance. -
.lwrenvLower bound of the simulated envelope, if the fittedmixpoissonregobject, was fitted with envelopes > 0. -
.mdnenvMedian of the simulated envelope, if the fittedmixpoissonregobject, was fitted with envelopes > 0. -
.uprenvUpper bound of the simulated envelope, if the fittedmixpoissonregobject, was fitted with envelopes > 0.
See Also
glance.mixpoissonreg, tidy.mixpoissonreg, tidy_local_influence.mixpoissonreg,
autoplot.mixpoissonreg, local_influence_autoplot.mixpoissonreg