augment: Augment a 'modeler' object with influence diagnostics

View source: R/11_influence.R

augmentR Documentation

Augment a modeler object with influence diagnostics

Description

This function computes various influence diagnostics, including standardized residuals, studentized residuals, and Cook's distance, for an object of class modeler.

Usage

augment(x, id = NULL, metadata = TRUE, ...)

Arguments

x

An object of class modeler.

id

Optional unique identifier to filter by a specific group. Default is NULL.

metadata

Logical. If TRUE, metadata is included with the predictions. Default is FALSE

...

Additional parameters for future functionality.

Value

A tibble containing the following columns:

uid

Unique identifier for the group.

fn_name

Function name associated with the model.

x

Predictor variable values.

y

Observed response values.

.fitted

Fitted values from the model.

.resid

Raw residuals (observed - fitted).

.hat

Leverage values for each observation.

.cooksd

Cook's distance for each observation.

.std.resid

Standardized residuals.

.stud.resid

Studentized residuals.

Author(s)

Johan Aparicio [aut]

Examples

library(flexFitR)
data(dt_potato)
mod_1 <- dt_potato |>
  modeler(
    x = DAP,
    y = Canopy,
    grp = Plot,
    fn = "fn_logistic",
    parameters = c(a = 0.199, t0 = 47.7, k = 100),
    subset = 2
  )
print(mod_1)
augment(mod_1)

flexFitR documentation built on April 16, 2025, 5:09 p.m.