Package 'AgreementInterval'

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

Help Index


agrInt2alpha

Description

Function agrInt2alpha calculates discordance rate (alpha) using clinically meaningful limit.

Usage

agrInt2alpha(clin.limit, n, sigmae)

Arguments

clin.limit

Clinically meaningful lower and upper limit

n

Sample size

sigmae

Variance estimate of residual from measurement error model

Details

Function agrInt2alpha calculates discordance rate (alpha) using clinically meaningful limit.

Value

Discordance rate

Author(s)

Jialin Xu, Jason Liao

References

Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133

Examples

agrInt2alpha(clin.limit=c(-15, 15), n=52, sigmae=46.09245)

ai

Description

Calculate Agreement Interval of Two Measurement Methods and quantify the agreement

Usage

ai(x, y, lambda = 1, alpha = 0.05, clin.limit = NA)

Arguments

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)

Details

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

Value

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

Author(s)

Jialin Xu, Jason Liao

References

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

Examples

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))

aiAdj

Description

Function aiAdj calculates bias-adjusted average interval from ai object

Usage

aiAdj(object, x)

Arguments

object

ai object from ai function

x

A numeric value or a vector of numeric values to calculate bias-adjusted average interval for

Details

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.

Value

bias-adjusted and total-adjusted average interval for each value in x

Author(s)

Jialin Xu, Jason Liao

References

Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133

Examples

ans <- ai(x=IPIA$Tomography, y=IPIA$Urography)
aiAdj(object=ans, x=1)
aiAdj(object=ans, x=c(1, 2))

IPIA measures from 52 kidneys

Description

A dataset containing inferior pelvic infundibular angle (IPIA) dataset measured by urography and tomography on n=52 kidneys. The variables are as follows:

Usage

IPIA

Format

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

References

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.


plot.ai

Description

The plot method for ai objects

Usage

## S3 method for class 'ai'
plot(x, clin.limit = NA, which = 1:4, ...)

Arguments

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.

Details

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.

Value

Function plot.ai returns 2 by 2 plots (See details)

Author(s)

Jialin Xu, Jason Liao

References

Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133

Examples

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))

summary.ai

Description

The summary method for ai objects

Usage

## S3 method for class 'ai'
summary(object, ...)

Arguments

object

ai object from ai function

...

additional arguments affecting the summary produced

Value

Function summary.ai prints out key summaries on screen

Author(s)

Jialin Xu, Jason Liao

References

Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133

Examples

a <- c(1, 2, 3, 4, 7)
b <- c(1, 3, 2, 5, 3)
ans <- ai(x=a, y=b)
summary(ans)

tolProb

Description

Function tolProb calculates tolerance probability based on sample size (n), number of discordance pairs (k) and discordance rate (alpha).

Usage

tolProb(n, k, alpha = 0.05)

Arguments

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.

Details

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:

1i=0k(ni)(1α)niαiβ1-\sum _{i=0}^{k} {n\choose i} * {(1-\alpha)}^{n-i} * {\alpha}^i \ge \beta

Value

tolerance probability

Author(s)

Jialin Xu, Jason Liao

References

Jason J. Z. Liao, Quantifying an Agreement Study, Int. J. Biostat. 2015; 11(1): 125-133

Examples

tolProb(n=52, k=5, alpha=0.05)
tolProb(n=52, k=0, alpha=0.05)