View source: R/precision_plot.R
| plot.precision_study | R Documentation |
Creates visualizations for precision study results. Multiple plot types are available: variance component chart, CV profile across samples, and precision estimates summary.
## S3 method for class 'precision_study'
plot(
x,
type = c("variance", "cv", "precision"),
show_ci = TRUE,
colors = NULL,
title = NULL,
...
)
## S3 method for class 'precision_study'
autoplot(
object,
type = c("variance", "cv", "precision"),
show_ci = TRUE,
colors = NULL,
title = NULL,
...
)
x |
An object of class |
type |
Character; type of plot to create:
|
show_ci |
Logical; if |
colors |
Character vector of colors for the plot elements. If |
title |
Character; plot title. If |
... |
Additional arguments (currently ignored). |
object |
An object of class |
Variance component chart (type = "variance"):
Displays the proportion of total variance attributable to each source
(between-day, between-run, error/repeatability). Helps identify which
factors contribute most to measurement variability.
CV profile (type = "cv"):
For multi-sample studies, displays how CV varies across concentration
levels. Typically CV is higher at low concentrations. Requires data
from multiple samples/levels.
Precision summary (type = "precision"):
Forest plot showing precision estimates (repeatability, intermediate
precision, reproducibility) with confidence intervals.
A ggplot object that can be further customized.
precision_study() for performing the analysis,
summary.precision_study() for detailed results
# Create example data
set.seed(42)
prec_data <- data.frame(
day = rep(1:5, each = 6),
run = rep(rep(1:2, each = 3), 5),
value = rnorm(30, mean = 100, sd = 5)
)
prec_data$value <- prec_data$value + rep(rnorm(5, 0, 3), each = 6)
prec <- precision_study(prec_data, value = "value", day = "day", run = "run")
# Variance component chart (default)
plot(prec)
plot(prec, type = "variance")
# Precision estimates with CIs
plot(prec, type = "precision")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.