Bland-Altman analysis function for R. Package created as existing
functions don't suit my needs, and don't generate 95\
for bias and limits of agreement. This base function calculates the basic
statistics, and generates return values which can be used in the related
blandr.display
and bland.altamn.plot
functions. However
the return results can be used to generate a custom chart if desired.
blandr.statistics(method1, method2, sig.level = 0.95, LoA.mode = 1)
An object of class 'blandr' is returned. This is a list with the following elements:
List of arithmetic mean of the two methods
List of differences of the two methods
Returns the 'method1' list in the data frame if further evaluation is needed
Returns the 'method2' list in the data frame if further evaluation is needed
Significance level supplied to the function
Significance level convert to Z value
Bias of the two methods
Upper confidence interval of the bias (based on significance level)
Lower confidence interval of the bias (based on significance level)
Standard deviation for the bias
Standard error for the bias
Standard error for the limits of agreement
Upper limit of agreement
Upper confidence interval of the upper limit of agreement
Lower confidence interval of the upper limit of agreement
Lower limit of agreement
Upper confidence interval of the lower limit of agreement
Lower confidence interval of the lower limit of agreement
Differences/means*100
Number of observations
A regression equation to help determine if there is any proportional bias
The slope value of the regression equation
The intercept value of the regression equation
Either a formula, or a vector of numbers corresponding to the results from method 1.
A vector of numbers corresponding to the results from method 2. Only needed if X
is a vector.
(Optional) Two-tailed significance level. Expressed from 0 to 1. Defaults to 0.95.
(Optional) Switch to change how accurately the limits of agreement (LoA) are calculated from the bias and its standard deviation. The default is LoA.mode=1 which calculates LoA with the more accurate 1.96x multiplier. LoA.mode=2 uses the 2x multiplier which was used in the original papers. This should really be kept at default, except to double check calculations in older papers.
Deepankar Datta deepankar.datta@gmail.com
Based on: (1) Bland, J. M., & Altman, D. (1986). Statistical methods for assessing agreement between two methods of clinical measurement. The Lancet, 327(8476), 307-310. http://dx.doi.org/10.1016/S0140-6736(86)90837-8
Confidence interval work based on follow-up paper: (2) Altman, D. G., & Bland, J. M. (2002). Commentary on quantifying agreement between two methods of measurement. Clinical chemistry, 48(5), 801-802. http://www.clinchem.org/content/48/5/801.full.pdf
# Generates two random measurements
measurement1 <- rnorm(100)
measurement2 <- rnorm(100)
# Generates Bland-Altman statistics data of the two measurements
blandr.statistics( measurement1 , measurement2 )
Run the code above in your browser using DataLab