pubh (version 1.1.16)

bland_altman: Bland-Altman agreement plots.

Description

Bland-Altman agreement plots.

Usage

bland_altman(
  object = NULL,
  formula = NULL,
  data = NULL,
  pch = 20,
  size = 1,
  col = "black",
  transform = FALSE,
  ...
)

Arguments

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 formula can be found.

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 gf_point.

Details

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.

Examples

Run this code
# NOT RUN {
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)") %>%
 gf_theme(theme = sjPlot::theme_sjplot2(base_size = 9))

data(Sharples)

Sharples %>%
  bland_altman(srweight ~ weight, transform = TRUE) %>%
  gf_labs(x = "Mean of weights (kg)", y = "Measured weight / Self-reported weight") %>%
  gf_theme(theme = sjPlot::theme_sjplot2(base_size = 9))
# }

Run the code above in your browser using DataLab