View source: R/plot_residuals.R
| plot_residuals | R Documentation |
Plots residuals for an individual bottle.
plot_residuals(fit, head = NULL)
fit |
A fitted model object containing a predictions element. |
head |
Optional Head identifier. If omitted and only one bottle is present, that bottle is plotted automatically. |
Residuals are calculated as:
Residual = Observed - Predicted
Residual plots are useful for:
Identifying systematic model bias
Detecting outliers
Evaluating model assumptions
Assessing goodness of fit
Ideally, residuals should be randomly distributed around zero with no obvious trend through time.
A ggplot2 object.
plot_fit,
plot_residual_comparison,
plot_diagnostics,
fit_groot
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
)
fit <- fit_groot(
gp
)
plot_residuals(
fit,
head = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.