Title: | Agreement Interval of Two Measurement Methods |
---|---|
Description: | A tool for calculating agreement interval of two measurement methods (Jason Liao (2015) <DOI:10.1515/ijb-2014-0030>) and present results in plots with discordance rate and/or clinically meaningful limit to quantify agreement quality. |
Authors: | Jialin Xu [aut, cre], Jason Liao [aut] |
Maintainer: | Jialin Xu <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-02-22 02:54:14 UTC |
Source: | https://github.com/cran/AgreementInterval |
Function agrInt2alpha calculates discordance rate (alpha) using clinically meaningful limit.
agrInt2alpha(clin.limit, n, sigmae)
agrInt2alpha(clin.limit, n, sigmae)
clin.limit |
Clinically meaningful lower and upper limit |
n |
Sample size |
sigmae |
Variance estimate of residual from measurement error model |
Function agrInt2alpha calculates discordance rate (alpha) using clinically meaningful limit.
Discordance rate
Jialin Xu, Jason Liao
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
agrInt2alpha(clin.limit=c(-15, 15), n=52, sigmae=46.09245)
agrInt2alpha(clin.limit=c(-15, 15), n=52, sigmae=46.09245)
Calculate Agreement Interval of Two Measurement Methods and quantify the agreement
ai(x, y, lambda = 1, alpha = 0.05, clin.limit = NA)
ai(x, y, lambda = 1, alpha = 0.05, clin.limit = NA)
x |
A continous numeric vector from measurement method 1 |
y |
A continous numeric vector from measurement method 2, the same length as x. |
lambda |
Reliability ratio of x vs y. default 1. |
alpha |
Discordance rate to estimate confidence interval |
clin.limit |
Clinically meaningful limit (optional) |
This is the function to calculate agreement interval (confidence interval) of two continuous numerical vectors from two measurement methods on the same samples. Note that this function only works for scenario with two evaluators, for example, comparing the concordance between two evaluators. We are working on the scenario with more than two evaluators.
The two numerical vectors are x
and y
. It also provides commonly used measures based on index approaches,
for example, Pearson's correlation coefficient, the intraclass correlation coefficient (ICC),
the concordance correlation coefficient (Lin's CCC), and improved CCC (Liao's ICCC).
Function ai returns an object of class "ai".
An object of class "ai" is a list containing the following components:
alpha: Alpha input for confidence interval estimates
n: Sample size
conf.level: Confidence level calculated from alpha
lambda: Reliability ratio input of x vs y
summaryStat: Summary statistics of input data
sigma.e: Random error estimates
indexEst: Agreement estimates (CI.) based on index approaches
intervalEst: Agreement estimates (CI.) based on interval approaches
biasEst: Bias estimate
intercept: Intercept of linear regression line from measure error model
slope: Slope of linear regression line from measure error model
x.name: x variable name extracted from input, used for plotting
y.name: y variable name extracted from input, used for plotting
tolProb.cl: Tolrance probability calculated based on optional clinically meaningful limit
k.cl: Number of discordance pairs based on optional clinically meaningful limit
alpha.cl: Discordance rate based on clinically meaningful limit
Jialin Xu, Jason Liao
Luiz RR, Costa AJL, Kale PL, Werneck GL. Assessment of agreement of a quantitative variable: a new graphical approach. J Clin Epidemiol 2003; 56:963-7.
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
Shrout, Patrick E. and Fleiss, Joseph L. Intraclass correlations: uses in assessing rater reliability. Psychological Bulletin, 1979, 86, 420-3428.
Lin L-K., A Concordance Correlation Coefficient to Evaluate Reproducibility. Biometrics 1989; 45:255-68
Liao JJ. An Improved Concordance Correlation Coefficient. Pharm Stat 2003; 2:253-61
Nicole Jill-Marie Blackman, Reproducibility of Clinical Data I: Continuous Outcomes, Pharm Stat 2004; 3:99-108
ai(x=1:4, y=c(1, 1, 2, 4)) a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ai(x=a, y=b) ai(x=IPIA$Tomography, y=IPIA$Urography) ai(x=IPIA$Tomography, y=IPIA$Urography, clin.limit=c(-15, 15))
ai(x=1:4, y=c(1, 1, 2, 4)) a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ai(x=a, y=b) ai(x=IPIA$Tomography, y=IPIA$Urography) ai(x=IPIA$Tomography, y=IPIA$Urography, clin.limit=c(-15, 15))
Function aiAdj calculates bias-adjusted average interval from ai object
aiAdj(object, x)
aiAdj(object, x)
object |
ai object from ai function |
x |
A numeric value or a vector of numeric values to calculate bias-adjusted average interval for |
Function aiAdj uses proportional bias per x
unit, Liao's average interval,
Liao's average interval adjusted for fixed bias to calculate bias-adjusted and total-adjusted average interval.
bias-adjusted and total-adjusted average interval for each value in x
Jialin Xu, Jason Liao
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
ans <- ai(x=IPIA$Tomography, y=IPIA$Urography) aiAdj(object=ans, x=1) aiAdj(object=ans, x=c(1, 2))
ans <- ai(x=IPIA$Tomography, y=IPIA$Urography) aiAdj(object=ans, x=1) aiAdj(object=ans, x=c(1, 2))
A dataset containing inferior pelvic infundibular angle (IPIA) dataset measured by urography and tomography on n=52 kidneys. The variables are as follows:
IPIA
IPIA
A data frame with 52 rows and 3 variables:
id: sample ids
Urography: IPIA data evaluated by means of computerized urography
Tomography: IPIA data evaluated by means of computerized tomography
Luiz RR, Costa AJL, Kale PL, Werneck GL. Assessment of agreement of a quantitative variable: a new graphical approach. J Clin Epidemiol 2003; 56:963-7.
The plot method for ai objects
## S3 method for class 'ai' plot(x, clin.limit = NA, which = 1:4, ...)
## S3 method for class 'ai' plot(x, clin.limit = NA, which = 1:4, ...)
x |
ai object from ai function |
clin.limit |
Clinically meaningful lower and upper limit |
which |
Index parameter to control which plot to output, by default, all four plots will be outputed. |
... |
Additional arguments to be passed to the round function and to control number of decimals in the display. |
The four plots include 1) scatterplot of raw data with regression line from the measurement error model, 2) Difference between two measurement methods with original average interval determined by alpha and clinically meaningful lower and upper limit, 3) Difference between two measurement methods with average interval adjusted for fixed bias, as well as 4) Sorted difference bewteen two measurement methods with average interval adjusted for total bias.
Function plot.ai returns 2 by 2 plots (See details)
Jialin Xu, Jason Liao
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ans <- ai(x=a, y=b) plot(x=ans) plot(x=ans, clin.limit=c(-5, 5))
a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ans <- ai(x=a, y=b) plot(x=ans) plot(x=ans, clin.limit=c(-5, 5))
The summary method for ai objects
## S3 method for class 'ai' summary(object, ...)
## S3 method for class 'ai' summary(object, ...)
object |
ai object from ai function |
... |
additional arguments affecting the summary produced |
Function summary.ai prints out key summaries on screen
Jialin Xu, Jason Liao
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ans <- ai(x=a, y=b) summary(ans)
a <- c(1, 2, 3, 4, 7) b <- c(1, 3, 2, 5, 3) ans <- ai(x=a, y=b) summary(ans)
Function tolProb calculates tolerance probability based on sample size (n), number of discordance pairs (k) and discordance rate (alpha).
tolProb(n, k, alpha = 0.05)
tolProb(n, k, alpha = 0.05)
n |
Sample size |
k |
Number of discordance pairs, discordance pairs are defined as samples with difference greater than average interval |
alpha |
Discordance rate, default 0.05. |
Function tolProb calculates tolearance probability based on sample size(n), number of discordance pairs (k) and discordance rate (alpha). Its value is calculated as the largest value such that the following inequality is true:
tolerance probability
Jialin Xu, Jason Liao
Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133
tolProb(n=52, k=5, alpha=0.05) tolProb(n=52, k=0, alpha=0.05)
tolProb(n=52, k=5, alpha=0.05) tolProb(n=52, k=0, alpha=0.05)