blandr.statistics: Bland-Altman statistics for R

View source: R/blandr.statistics.r

blandr.statisticsR Documentation

Bland-Altman statistics for R

Description

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.

Usage

blandr.statistics(method1, method2, sig.level = 0.95, LoA.mode = 1)

Arguments

method1

Either a formula, or a vector of numbers corresponding to the results from method 1.

method2

A vector of numbers corresponding to the results from method 2. Only needed if X is a vector.

sig.level

(Optional) Two-tailed significance level. Expressed from 0 to 1. Defaults to 0.95.

LoA.mode

(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.

Value

An object of class 'blandr' is returned. This is a list with the following elements:

means

List of arithmetic mean of the two methods

differences

List of differences of the two methods

method1

Returns the 'method1' list in the data frame if further evaluation is needed

method2

Returns the 'method2' list in the data frame if further evaluation is needed

sig.level

Significance level supplied to the function

sig.level.convert.to.z

Significance level convert to Z value

bias

Bias of the two methods

biasUpperCI

Upper confidence interval of the bias (based on significance level)

biasLowerCI

Lower confidence interval of the bias (based on significance level)

biasStdDev

Standard deviation for the bias

biasSEM

Standard error for the bias

LOA_SEM

Standard error for the limits of agreement

upperLOA

Upper limit of agreement

upperLOA_upperCI

Upper confidence interval of the upper limit of agreement

upperLOA_lowerCI

Lower confidence interval of the upper limit of agreement

lowerLOA

Lower limit of agreement

lowerLOA_upperCI

Upper confidence interval of the lower limit of agreement

lowerLOA_lowerCI

Lower confidence interval of the lower limit of agreement

proportion

Differences/means*100

no.of.observations

Number of observations

regression.equation

A regression equation to help determine if there is any proportional bias

regression.fixed.slope

The slope value of the regression equation

regression.fixed.intercept

The intercept value of the regression equation

Note

The function will give similar answers when used on the original Bland-Altman PEFR data sets. They won't be exactly the same as (a) for 95\

The function depends on paired values.

It currently only can currently work out fixed bias.

Improvements for the future: proportional bias charts will need further work

Started 2015-11-14

Last update 2016-02-04

Originally designed for LAVAS and CVLA

Author(s)

Deepankar Datta deepankar.datta@gmail.com

References

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

Examples


# Generates two random measurements
measurement1 <- rnorm(100)
measurement2 <- rnorm(100)

# Generates Bland-Altman statistics data of the two measurements
blandr.statistics( measurement1 , measurement2 )


blandr documentation built on June 22, 2024, 10:58 a.m.