MyNixOS website logo
Description

Clinical Tolerance Limits for Assessing Agreement.

Implements clinical tolerance limits (CTL) methodology for assessing agreement between two measurement methods. Estimates the true latent trait using Best Linear Unbiased Predictors (BLUP), models bias and variance components, and calculates overall and conditional agreement probabilities. Provides visualization tools including tolerance limit plots and conditional probability of agreement plots with confidence bands. This package is based on methods described in Taffé (2016) <doi:10.1177/0962280216666667>, Taffé (2019) <doi:10.1177/0962280219844535>, and 'Stata' package Taffé (2025) <doi:10.1177/1536867X251365501>.

Clinical Tolerance Limits - ctlr R package

The ctlr package implements clinical tolerance limits (CTL) methodology for assessing agreement between two measurement methods. It estimates the true latent trait using Best Linear Unbiased Predictors (BLUP), models bias and variance components, and calculates overall and conditional agreement probabilities.

Features

  • Estimate differential and proportional bias between measurement methods
  • Model variance components as functions of the latent trait
  • Calculate overall agreement probabilities with confidence intervals
  • Generate tolerance limit plots
  • Generate conditional probability of agreement plots with pointwise and/or simultaneous confidence bands
  • Two example datasets (ctl_dataset1 and ctl_dataset2) included for demonstration

Installation

You can install the ctlr package from CRAN:

install.packages("ctlr")

You can install the development version of ctlr from GitHub with:

# install.packages("devtools")
devtools::install_github("elianemaalouf/ctlr")

Example

Basic usage examples:

library(ctlr)

# Example with tolerance limit plot
ctl(
  ctl_dataset1,
  idvar = "id",
  ynew = "y1",
  yref = "y2",
  intercept = 5,
  slope = 0,
  tlplot = TRUE
)
#> 
#> Use of Clinical Tolerance Limits (CTL) for assessing agreement
#> **************************************************************
#> ID Variable: id
#> New Method Y Variable: y1
#> Reference Method Y Variable: y2
#> Running...
#> seed set to 123456789
#> Constant tolerance limits specified: intercept= 5& slope= 0
#> Estimating BLUP for latent trait...
#> diff_bias= 3.348273 , 95%CI=[ 1.60864 ; 5.087905 ]
#> prop_bias= 0.833226 , 95%CI=[ 0.7876876 ; 0.8787644 ]
#> 
#> Generating Tolerance Limits Plot
#> **************************************************************

# Example with conditional probability of agreement plot
ctl(
  ctl_dataset1,
  idvar = "id",
  ynew = "y1",
  yref = "y2",
  intercept = 5,
  slope = 0,
  cpaplot = TRUE
)
#> 
#> Use of Clinical Tolerance Limits (CTL) for assessing agreement
#> **************************************************************
#> ID Variable: id
#> New Method Y Variable: y1
#> Reference Method Y Variable: y2
#> Running...
#> seed set to 123456789
#> Constant tolerance limits specified: intercept= 5& slope= 0
#> Estimating BLUP for latent trait...
#> diff_bias= 3.348273 , 95%CI=[ 1.60864 ; 5.087905 ]
#> prop_bias= 0.833226 , 95%CI=[ 0.7876876 ; 0.8787644 ]
#> Number of simulations used for CPA plot is set to 1000
#> 
#> Generating Conditional probability of agreement plot
#> **************************************************************

# Example with non-constant tolerance limits
ctl(
  ctl_dataset2,
  idvar = "id",
  ynew = "y1",
  yref = "y2",
  intercept = 1,
  slope = 0.2,
  seed = 11446158,
  cpaplot = TRUE
)
#> 
#> Use of Clinical Tolerance Limits (CTL) for assessing agreement
#> **************************************************************
#> ID Variable: id
#> New Method Y Variable: y1
#> Reference Method Y Variable: y2
#> Running...
#> seed set to 11446158
#> Non-constant tolerance limits specified: intercept= 1& slope= 0.2
#> Estimating BLUP for latent trait...
#> diff_bias= 5.142302 , 95%CI=[ 2.599347 ; 7.685256 ]
#> prop_bias= 0.7953882 , 95%CI=[ 0.7347545 ; 0.856022 ]
#> Number of simulations used for CPA plot is set to 1000
#> 
#> Generating Conditional probability of agreement plot
#> **************************************************************

References

The methodology implemented in this package is based on:

License

GPL(>=3)

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows