maplot: Bland Altman plot aka MA plot

Description Usage Arguments Author(s) Examples

View source: R/maplot.R

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

1
2
3
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 length(x) is larger than n, the x and y are sampled down.

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 TRUE a smooth curve is fit to the data and displayed. The function loess is used to fit the curve.

curve.col

a numeric value that determines the color of the smooth curve

curve.span

is passed on to loess as the span argument

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 plot

Author(s)

Rafael A. Irizarry

Examples

1
2
3
4
5
6
n <- 10000
signal <- runif(n,4,15)
bias <- (signal/5 - 2)^2 
x <- signal + rnorm(n)
y <- signal + bias + rnorm(n)  
maplot(x,y)

ririzarr/rafalib documentation built on April 17, 2021, 8:56 p.m.