baplot: Produce a Bland-Altman plot.

Description Usage Arguments Details References Examples

View source: R/sklarsomega.R

Description

Produce a Bland-Altman plot.

Usage

1
2
3
baplot(x, y, pch = 20, col = "black", bg = "black", main = "",
  xlab = "Mean", ylab = "Difference", lwd1 = 1, lwd2 = 1, cex = 1,
  lcol = "black")

Arguments

x

the first vector of outcomes.

y

the second vector of outcomes.

pch

the plotting character. Defaults to 20, a bullet.

col

the foreground color. Defaults to black.

bg

the background color. Defaults to black.

main

a title for the plot. Defaults to no title, i.e., "".

xlab

a title for the x axis. Defaults to "Mean".

ylab

a title for the y axis. Defaults to "Difference".

lwd1

the line width for the scatter plot. Defaults to 1.

lwd2

the line width for the confidence band. Defaults to 1.

cex

scaling factor for the scatter plot. Defaults to 1.

lcol

line color for the confidence band. Defaults to black.

Details

This function produces rather customizable Bland-Altman plots, using the plot and abline functions. The former is used to create the scatter plot. The latter is used to display the confidence band.

References

Altman, D. G. and Bland, J. M. (1983). Measurement in medicine: The analysis of method comparison studies. The Statistician, 307–317.

Nissi, M. J., Mortazavi, S., Hughes, J., Morgan, P., and Ellermann, J. (2015). T2* relaxation time of acetabular and femoral cartilage with and without intra-articular Gd-DTPA2 in patients with femoroacetabular impingement. American Journal of Roentgenology, 204(6), W695.

Examples

1
2
3
4
5
# Reproduce the plot from Figure 4 of the package vignette.

data(cartilage)
baplot(cartilage$pre, cartilage$post, pch = 21, col = "navy", bg = "darkorange", lwd1 = 2,
       lwd2 = 2, lcol = "navy")

sklarsomega documentation built on July 1, 2020, 6:07 p.m.