View source: R/robust_BA_plot.R
robustBAplot | R Documentation |
The function allows to plot a robust version of the Bland-Altman plot.
robustBAplot( a, b, z = 1.96, methAlab = "Method A", methBlab = "Method B", cex = 0.6 )
a |
Vector storing the first set of measurements to be compared. |
b |
Vector storing the second set of measurements to be compared. |
z |
Value for the confidence interval for the median difference; set by default to 1.96 (corresponding to 95 percent CI). |
methAlab |
Label to be used in the returned chart to refer to the method yielding the first set of measurements. |
methBlab |
Label to be used in the returned chart to refer to the method yielding the second set of measurements. |
cex |
Size of the data points. |
The function returns a chart based on robust (i.e. resistant to outlying values) measures of
central tendency and variability: median and Median Absolute Deviation (MAD) (Wilcox R R. 2001.
"Fundamentals of modern statistical methods: Substantially improving power and accuracy". New
York: Springer) instead of mean and standard deviation.
The x-axis displays the median of the two variables being compared, while the y-axis represents their difference. A solid horizontal line represents the bias, i.e. the median of the differences reported on the y-axis. Two dashed horizontal lines represent the region in which 95percent of the observations are expected to lie; they are set at the median plus or minus z*(MAD/0.6745).
#create a first toy vector a <- rnorm(30,10,1) #create a second toy vector b <- a*runif(30,1,1.5) robustBAplot(a,b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.