compare_models_by_treatment: Compare Models by Treatment

View source: R/compare_models_by_treatment.R

compare_models_by_treatmentR Documentation

Compare Models by Treatment

Description

Calculates model performance separately for each treatment.

Usage

compare_models_by_treatment(...)

Arguments

...

Fitted model objects.

Details

Performance metrics are computed using treatment-level predictions and observations, allowing direct comparison of competing models within each treatment.

Typical metrics include:

  • R-squared (R²)

  • Root Mean Squared Error (RMSE)

  • Residual Sum of Squares (RSS)

  • Akaike Information Criterion (AIC)

  • Bayesian Information Criterion (BIC)

This function is useful for determining whether different treatments are best described by different kinetic models.

Value

A data frame containing treatment-level performance metrics for each fitted model.

See Also

compare_models, rank_models_by_treatment, best_model_by_treatment, model_win_frequency

Examples


files <- example_data()

raw_data <- read_ankom(
  files$ankom
)

metadata <- read_metadata(
  files$metadata
)

gp <- process_ankom(
  raw_data,
  metadata,
  headspace_ml = 210,
  temperature_c = 39
)

groot_fit <- fit_groot(
  gp
)

gompertz_fit <- fit_gompertz(
  gp
)

compare_models_by_treatment(
  Groot = groot_fit,
  Gompertz = gompertz_fit
)


rumenGP documentation built on Oct. 2, 2026, 5:09 p.m.