View source: R/plot_functions.R
bland_altman | R Documentation |
Bland-Altman agreement plots.
bland_altman(
object = NULL,
formula = NULL,
data = NULL,
pch = 20,
size = 1,
col = "black",
transform = FALSE,
...
)
object |
When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples. |
formula |
A formula with shape: y ~ x (see details). |
data |
A data frame where the variables in the |
pch |
Symbol for plotting data. |
size |
Size of the symbol using to plot data. |
col |
Colour used for the symbol to plot data. |
transform |
Logical, should ratios instead of difference be used to construct the plot? |
... |
Further arguments passed to |
bland_altman
constructs Bland-Altman agreement plots.
Variables in formula
are continuous paired observations. When the distribution of the outcome
is not normal, but becomes normal with a log-transformation, bland_altman
can plot the ratio between
outcomes (difference in the log scale) by using option transform = TRUE
.
data(wright, package = "ISwR")
wright |>
bland_altman(mini.wright ~ std.wright,
pch = 16,
ylab = "Large-mini expiratory flow rate (l/min)",
xlab = "Mean expiratory flow rate (l/min)"
) |>
gf_labs(
y = "Large-mini expiratory flow rate (l/min)",
x = "Mean expiratory flow rate (l/min)"
)
data(Sharples)
Sharples |>
bland_altman(srweight ~ weight, transform = TRUE) |>
gf_labs(x = "Mean of weights (kg)", y = "Measured weight / Self-reported weight")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.