limitsOfAgreement: MRMC Analysis of Limits of Agreement using ANOVA

limitsOfAgreementR Documentation

MRMC Analysis of Limits of Agreement using ANOVA

Description

These four functions calculate four types of Limits of Agreement using ANOVA: Within-Reader Within-Modality(WRWM), Between-Reader Within-Modality(BRWM), Within-Reader Between-Modality(WRBM), and Between-Reader Between-Modality(BRBM). The 95% confidence interval of the mean difference is also provided. If the study is fully crossed, the ANOVA methods are realized either by applying stats::aov or by matrix multiplication. Otherwise, the SS in ANOVA are computed as residual sums of squares of linear models. See details below about the model structure and these references.

  • S. Wen and B. D. Gallas, “Three-Way Mixed Effect ANOVA to Estimate MRMC Limits of Agreement,” Statistics in Biopharmaceutical Research, 14, pp. 532–541, 2022, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/19466315.2022.2063169")}.

  • S. Wen and B. D. Gallas, “Expanding to Arbitrary Study Designs: ANOVA to Estimate Limits of Agreement for MRMC Studies,” arXiv, 2023, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/ARXIV.2312.16097")}.

Usage

laWRBM(
  df,
  modalitiesToCompare = c("testA", "testB"),
  keyColumns = c("readerID", "caseID", "modalityID", "score"),
  if.aov = TRUE,
  type = 1,
  reader.first = TRUE
)

laBRWM(
  df,
  modality = c("testA"),
  keyColumns = c("readerID", "caseID", "modalityID", "score"),
  if.aov = TRUE,
  type = 1,
  reader.first = TRUE
)

laWRWM(
  df,
  replicatesToCompare = c("testA", "testB"),
  keyColumns = c("readerID", "caseID", "modalityID", "score"),
  if.aov = TRUE,
  type = 1,
  reader.first = TRUE
)

laBRBM(
  df,
  modalitiesToCompare = c("testA", "testB"),
  keyColumns = c("readerID", "caseID", "modalityID", "score"),
  if.aov = TRUE,
  type = 1,
  reader.first = TRUE,
  is.sparseQR = T
)

Arguments

df

Data frame of observations, one per row. Columns identify random effects, fixed effects, and the observation. Namely,

readerID

The factor corresponding to the different readers in the study. The readerID is treated as a random effect.

caseID

The factor corresponding to the different cases in the study. The caseID is treated as a random effect.

modalityID

The factor corresponding to the different modalities in the study. The modalityID is treated as a fixed effect.

score

The number (observation) given by the reader to the case for the modality indicated.

modalitiesToCompare

The factors identifying the modalities to compare. It should be length 2. Default = c("testA","testB")

keyColumns

Identify the factors corresponding to the readerID (random effect), caseID (random effect), modalityID (fixed effect), and score (observation). Default = c("readerID", "caseID", "modalityID", "score")

if.aov

Boolean value to determine whether to use the 'stats::aov' function or to calculate the ANOVA statistics explicitly. 'stats::aov' is only appropriate for fully-crossed study only. This flag permits head-to-head comparisons of the output from 'stats::aov' and the explicit calculations. Default = TRUE

type

Identify how SS are computed in ANOVA for unbalanced study designs. The possible values are c(1,2,3), corresponding to the approaches introduced in the SAS package(Langsrud2003_Stat-Comput_v13p163).

Default type= 1

reader.first

Boolean value to determine whether reader effect is added to the model before the case effect. Default reader.first = TRUE

modality

The factor identifying the modality for laBRWM. It should be length 1. Default = modality = c("testA")

replicatesToCompare

The factors identifying the replicates to compare for laWRWM. It should be length 2. Default = c("testA","testB")

is.sparseQR

Boolean value to determine whether the 'base::qr' function assumes the input data is sparse or not. Default = TRUE

Details

Suppose the score from a reader j for case k under modality i isX_{ijk}, then the difference score from the same reader for the same case under two different modalities is Y_{jk} = X_{1jk} - X_{2jk}.

  • laWRBM use two-way random effect ANOVA to analyze the difference scores Y_{jk}. The model is Y_{jk}=\mu + R_j + C_k + \epsilon_{jk}, where R_j and C_k are random effects for readers and cases. The variances of mean and individual observations are expressed as linear combinations of the MS given by ANOVA.

  • laBRWM use two-way random effect ANOVA to analyze the scores X_{jk} for a single modality. The model is X_{jk}=\mu + R_j + C_k + \epsilon_{jk}, where R_j and C_k are random effects for readers and cases. The variances of mean and individual observations are expressed as linear combinations of the MS given by ANOVA.

  • laWRWM use two-way random effect ANOVA to analyze the difference scores Y_{jk} from the same reader for the same cases under the same modality with different replicates Y_{jk} = X_{jk1} - X_{jk2}. The model is Y_{jk}=\mu + R_j + C_k + \epsilon_{jk}, where R_j and C_k are random effects for readers and cases. The variances of mean and individual observations are expressed as linear combinations of the MS given by ANOVA.

  • laBRBM use three-way mixed effect ANOVA to analyze the scores X_{ijk}. The model is given by X_{ijk}=\mu + R_j + C_k + m_i + RC_{jk} + mR_{ij} + mC_{ik} + \epsilon_{ijk}, where R_j and C_k are random effects for readers and cases, m_i is a fixed effect for modality, and the other terms are interaction terms. The variances of mean and individual observations are expressed as linear combinations of the MS given by ANOVA.

Value

A list of two dataframes.

The first dataframe is limits.of.agreement. It has one row. Each column is as follows:

meanDiff

The mean difference score.

var.MeanDiff

The variance of the mean difference score.

var.1obs

The variance of the difference score.

ci95meanDiff.bot

Lower bound of 95% CI for the mean difference score. meanDiff+ 1.96*sqrt(var.MeanDiff)

ci95meanDiff.top

Upper bound of 95% CI for the mean difference score. meanDiff- 1.96*sqrt(var.MeanDiff)

la.bot

Lower Limit of Agreement for the difference score. meanDiff+1.96*sqrt(var.1obs)

la.top

Upper Limit of Agreement for the difference score. meanDiff-1.96*sqrt(var.1obs)

The second dataframe is two.way.ANOVA or three.way.ANOVA shows the degrees of freedom, sums of squares, and estimates of variance components for each source of variation

Examples

# Initialize the simulation configuration parameters
config <- sim.NormalIG.Hierarchical.config(modalityID = c("testA", "testB"))

# Initizlize the seed and stream of the random number generator
init.lecuyerRNG()

# Simulate an MRMC ROC data set
dFrame <- sim.NormalIG.Hierarchical(config)

# Compute Limits of Agreement
laWRBM_result <- laWRBM(dFrame)
print(laWRBM_result)
laBRBM_result <- laBRBM(dFrame)
print(laBRBM_result)


iMRMC documentation built on Sept. 11, 2024, 7:12 p.m.