maplot {rafalib} | R Documentation |
Bland Altman plot aka MA plot
Description
Takes two vectors x and y and plots M=y-x versus A=(x+y)/2. If the vectors a more longer than length n the data is sampled to size n. A smooth curve is added to show trends.
Usage
maplot(x, y, n = 10000, subset = NULL, xlab = NULL, ylab = NULL,
curve.add = TRUE, curve.col = 2, curve.span = 1/2, curve.lwd = 2,
curve.n = 2000, ...)
Arguments
x |
a numeric vector |
y |
a numeric vector |
n |
a numeric value. If |
subset |
index of the points to be plotted |
xlab |
a title for the x axis |
ylab |
a title for the y axis |
curve.add |
if |
curve.col |
a numeric value that determines the color of the smooth curve |
curve.span |
is passed on to |
curve.lwd |
the line width for the smooth curve |
curve.n |
a numeric value that determines the sample size used to fit the curve. This makes fitting the curve faster with large datasets |
... |
further arguments passed to |
Author(s)
Rafael A. Irizarry
Examples
n <- 10000
signal <- runif(n,4,15)
bias <- (signal/5 - 2)^2
x <- signal + rnorm(n)
y <- signal + bias + rnorm(n)
maplot(x,y)