Learn R Programming

flexFitR (version 1.2.2)

augment: 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, ...)

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.

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.

Author

Johan Aparicio [aut]

Examples

Run this code
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)

Run the code above in your browser using DataLab