Description Usage Arguments Details Examples
View source: R/robust_BA_plot.R
The function allows to plot a robust version of the Bland-Altman plot.
1 2 | robustBAplot(a, b, z = 1.96, meth_A_lab = "Method A",
meth_B_lab = "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). |
meth_A_lab: |
label to be used in the returned chart to refer to the method yielding the first set of measurements. |
meth_B_lab: |
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).
1 2 3 | a <- rnorm(30,10,1) #create a first toy vector
b <- a*runif(30,1,1.5) #create a second toy vector
robustBAplot(a,b) #returns the robust BA plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.