compare_sir: Compare SIR results and generate categorical agreement

View source: R/meta_data.R

compare_sirR Documentation

Compare SIR results and generate categorical agreement

Description

Compare two AMR::sir vectors and generate a categorical agreement vector with the following levels: M (major error), vM (very major error), m (minor error). The error definitions are:

  1. Major error (M): The test result is resistant (R) when the gold standard is susceptible (S).

  2. vM (very major error): The test result is susceptible (S) when the gold standard is resistant (R).

  3. Minor error (m): The test result is intermediate (I) when the gold standard is susceptible (S) or resistant (R), or vice versa.

Usage

compare_sir(gold_standard, test)

Arguments

gold_standard

Susceptibility results in AMR::sir format

test

Susceptibility results in AMR::sir format

Value

factor vector with the following levels: M, vM, m.

Examples

gold_standard <- c("S", "R", "I", "I")
gold_standard <- AMR::as.sir(gold_standard)
test <- c("S", "I", "R", "R")
test <- AMR::as.sir(test)
compare_sir(gold_standard, test)

MIC documentation built on April 12, 2025, 2:26 a.m.