Learn R Programming

rmngb (version 0.6-1)

blandAltman: Bland-Altman Plot

Description

Produces a Bland-Altman plot.

Usage

blandAltman(x, ...) "blandAltman"(x, y, xlab = "Mean", ylab = "Difference", main = "Bland-Altman plot", sdLines = 2, ...) "blandAltman"(formula, data, subset, na.action, ...)

Arguments

x
measurements returned by method 1.
y
measurements returned by method 2.
xlab
a title for the x axis: see title.
ylab
a title for the y axis: see title.
main
an overall title for the plot: see title.
sdLines
how many standard deviations from the mean difference should the dotted lines be plotted.
formula
a formula of the form lhs ~ rhs where lhs is a numeric variable giving the data values and rhs a factor with two levels giving the corresponding methods.
data
an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).
subset
an optional vector specifying a subset of observations to be used.
na.action
a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").
...
arguments to be passed to plot.

Value

Nothing of interest.

Details

Plots the pairwise mean of x and y versus their pairwise difference. Adds horizontal lines at plus and minus sdLines standard deviation of the pairwise difference.

When used with the formula method values should be carefully ordered before in order to produce meaningful results.

Examples

Run this code
# meaningless examples
blandAltman(extra ~ group, data = sleep)
blandAltman(runif(20), runif(20))

Run the code above in your browser using DataLab