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 mixpoissonreg object.

data

A base::data.frame or tibble::tibble() containing the original data that was used to produce the object x.

newdata

A base::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 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 level, nsim_pred, nsim_pred_y are passed through additional arguments '...'. Notice that this can be computationally intensive.

...

Additional arguments. Possible additional arguments are level, nsim_pred, nsim_pred_y, that are passed to predict.mixpoissonreg function.

Value

A tibble::tibble() with columns:

See Also

glance.mixpoissonreg, tidy.mixpoissonreg, tidy_local_influence.mixpoissonreg, autoplot.mixpoissonreg, local_influence_autoplot.mixpoissonreg


[Package mixpoissonreg version 1.0.0 Index]