plot_treatment_mean: Plot Treatment Means Across Models

View source: R/plot_treatment_mean.R

plot_treatment_meanR Documentation

Plot Treatment Means Across Models

Description

Compares observed and predicted treatment means across multiple fitted models for a selected treatment.

Usage

plot_treatment_mean(..., treatment, show_se = TRUE)

Arguments

...

Fitted model objects.

treatment

Treatment name.

show_se

Logical. If TRUE, displays a standard-error ribbon around the observed treatment mean.

Details

The observed treatment mean is displayed as a black line with optional standard-error bands. Predicted treatment means from each fitted model are overlaid for visual comparison.

This visualization is useful for:

  • Comparing competing kinetic models

  • Evaluating treatment-level model performance

  • Assessing agreement between observations and predictions

  • Comparing fermentation dynamics among models

Value

A ggplot2 object.

See Also

plot_all_treatment_means, compare_models_by_treatment, fit_groot, fit_gompertz

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
)

plot_treatment_mean(
  Groot = groot_fit,
  Gompertz = gompertz_fit,
  treatment = unique(
    gp$Treatment
  )[1]
)


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