LoA | R Documentation |
Computes the limits of agreement between two measurements.
LoA(x, y, conf.level.CI = 0.95, conf.level.LoA = 0.95)
x |
[numeric vector] vector containing the first measurement, each value corresponding to an individual. |
y |
[numeric vector] vector containing the second measurement, each value corresponding to an individual (same as in |
conf.level.CI |
[numeric 0-1] confidence level of the confidence intervals. |
conf.level.LoA |
[numeric 0-1] confidence level for the limits of agreements. |
The bias is estimated as the average difference between y and x, i.e. bias = E[y-x]. The upper/lower limit of the limit of agreement are estimated as the bias plus/minus the LoA.multiplier times the standard deviation of y-x, i.e. E[y-x] +/- LoA.multiplier * sqrt(Var[y-x]).
The standard errors, confidence intervals, and p-values are computed for the limit of the limit of agreement are computed using a delta method.
set.seed(10)
X <- rnorm(100)
Y <- X + rnorm(100)
e.loa <- LoA(x = X, y = Y)
e.loa
autoplot(e.loa)
if(require(blandr)){ ## same results as blandr.statistics
e.blandr <- blandr.statistics(method1 = Y, method2 = X)
e.loa$LoA$estimate - c(e.blandr$bias, e.blandr$lowerLOA, e.blandr$upperLOA)
e.loa$LoA$lower - c(e.blandr$biasLowerCI, e.blandr$lowerLOA_lowerCI, e.blandr$upperLOA_lowerCI)
e.loa$LoA$upper - c(e.blandr$biasUpperCI, e.blandr$lowerLOA_upperCI, e.blandr$upperLOA_upperCI)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.