antibiogram(x, antibiotics = where(is.sir), mo_transform = "shortname",
ab_transform = "name", syndromic_group = NULL, add_total_n = FALSE,
- only_all_tested = FALSE, digits = 0,
+ only_all_tested = FALSE, digits = ifelse(wisca, 1, 0),
formatting_type = getOption("AMR_antibiogram_formatting_type",
- ifelse(wisca, 18, 10)), col_mo = NULL, language = get_AMR_locale(),
+ ifelse(wisca, 14, 10)), col_mo = NULL, language = get_AMR_locale(),
minimum = 30, combine_SI = TRUE, sep = " + ", wisca = FALSE,
simulations = 1000, conf_interval = 0.95, interval_side = "two-tailed",
info = interactive())
wisca(x, antibiotics = where(is.sir), mo_transform = "shortname",
ab_transform = "name", syndromic_group = NULL, add_total_n = FALSE,
- only_all_tested = FALSE, digits = 0,
- formatting_type = getOption("AMR_antibiogram_formatting_type", 18),
+ only_all_tested = FALSE, digits = 1,
+ formatting_type = getOption("AMR_antibiogram_formatting_type", 14),
col_mo = NULL, language = get_AMR_locale(), minimum = 30,
combine_SI = TRUE, sep = " + ", simulations = 1000,
info = interactive())
+retrieve_wisca_parameters(wisca_model, ...)
+
# S3 method for class 'antibiogram'
plot(x, ...)
@@ -103,11 +105,11 @@ Adhering to previously described approaches (see Source) and especially the Baye
antibiotics
-vector of any antimicrobial name or code (will be evaluated with as.ab()
, column name of x
, or (any combinations of) antimicrobial selectors such as aminoglycosides()
or carbapenems()
. For combination antibiograms, this can also be set to values separated with "+"
, such as "TZP+TOB" or "cipro + genta", given that columns resembling such antimicrobials exist in x
. See Examples.
+vector of any antimicrobial name or code (will be evaluated with as.ab()
, column name of x
, or (any combinations of) antimicrobial selectors such as aminoglycosides()
or carbapenems()
. For combination antibiograms, this can also be set to values separated with "+"
, such as "TZP+TOB"
or "cipro + genta"
, given that columns resembling such antimicrobials exist in x
. See Examples.
mo_transform
-a character to transform microorganism input - must be "name"
, "shortname"
(default), "gramstain"
, or one of the column names of the microorganisms data set: "mo", "fullname", "status", "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies", "rank", "ref", "oxygen_tolerance", "source", "lpsn", "lpsn_parent", "lpsn_renamed_to", "mycobank", "mycobank_parent", "mycobank_renamed_to", "gbif", "gbif_parent", "gbif_renamed_to", "prevalence", or "snomed". Can also be NULL
to not transform the input.
+a character to transform microorganism input - must be "name"
, "shortname"
(default), "gramstain"
, or one of the column names of the microorganisms data set: "mo", "fullname", "status", "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies", "rank", "ref", "oxygen_tolerance", "source", "lpsn", "lpsn_parent", "lpsn_renamed_to", "mycobank", "mycobank_parent", "mycobank_renamed_to", "gbif", "gbif_parent", "gbif_renamed_to", "prevalence", or "snomed". Can also be NULL
to not transform the input or NA
to consider all microorganisms 'unknown'.
ab_transform
@@ -127,7 +129,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
digits
-number of digits to use for rounding the susceptibility percentage
+number of digits to use for rounding the antimicrobial coverage, defaults to 1 for WISCA and 0 otherwise
formatting_type
@@ -155,11 +157,11 @@ Adhering to previously described approaches (see Source) and especially the Baye
wisca
-a logical to indicate whether a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) must be generated (default is FALSE
). This will use a Bayesian hierarchical model to estimate regimen coverage probabilities using Montecarlo simulations. Set simulations
to adjust.
+a logical to indicate whether a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) must be generated (default is FALSE
). This will use a Bayesian decision model to estimate regimen coverage probabilities using Monte Carlo simulations. Set simulations
to adjust.
simulations
-(for WISCA) a numerical value to set the number of Montecarlo simulations
+(for WISCA) a numerical value to set the number of Monte Carlo simulations
conf_interval
@@ -174,6 +176,10 @@ Adhering to previously described approaches (see Source) and especially the Baye
a logical to indicate info should be printed - the default is TRUE
only in interactive mode
+wisca_model
+the outcome of wisca()
or antibiogram(..., wisca = TRUE)
+
+
...
when used in R Markdown or Quarto: arguments passed on to knitr::kable()
(otherwise, has no use)
@@ -199,7 +205,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
-The formatting of the 'cells' of the table can be set with the argument formatting_type
. In these examples, 5
is the susceptibility percentage (for WISCA: 4-6
indicates the confidence level), 15
the numerator, and 300
the denominator:
5
+The formatting of the 'cells' of the table can be set with the argument formatting_type
. In these examples, 5
is the antimicrobial coverage (for WISCA: 4-6
indicates the confidence level), 15
the numerator, and 300
the denominator:
5
15
300
15/300
@@ -213,16 +219,16 @@ Adhering to previously described approaches (see Source) and especially the Baye
5% (N=15/300)
Additional options for WISCA (using antibiogram(..., wisca = TRUE)
or wisca()
):
5 (4-6)
-5% (4-6%)
+5% (4-6%) - default for WISCA
5 (4-6,300)
5% (4-6%,300)
5 (4-6,N=300)
-5% (4-6%,N=300) - default for WISCA
+5% (4-6%,N=300)
5 (4-6,15/300)
5% (4-6%,15/300)
5 (4-6,N=15/300)
5% (4-6%,N=15/300)
-
The default is 18
for WISCA and 10
for non-WISCA, which can be set globally with the package option AMR_antibiogram_formatting_type
, e.g. options(AMR_antibiogram_formatting_type = 5)
.
+
The default is 14
for WISCA and 10
for non-WISCA, which can be set globally with the package option AMR_antibiogram_formatting_type
, e.g. options(AMR_antibiogram_formatting_type = 5)
. Do note that for WISCA, the numerator and denominator are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level.
Set digits
(defaults to 0
) to alter the rounding of the susceptibility percentages.
@@ -233,7 +239,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
+
Grouped tibbles
+
+
+
For any type of antibiogram, grouped tibbles can also be used to calculate susceptibilities over various groups.
Code example:
-
-
Inclusion in Combination Antibiogram and Syndromic Antibiogram
+
Stepped Approach for Clinical Insight
-
Note that for types 2 and 3 (Combination Antibiogram and Syndromic Antibiogram), it is important to realise that susceptibility can be calculated in two ways, which can be set with the only_all_tested
argument (default is FALSE
). See this example for two antimicrobials, Drug A and Drug B, about how antibiogram()
works to calculate the %SI:
+
In clinical practice, antimicrobial coverage decisions evolve as more microbiological data becomes available. This theoretical stepped approach ensures empirical coverage can continuously assessed to improve patient outcomes:
Initial Empirical Therapy (Admission / Pre-Culture Data)
+At admission, no pathogen information is available.
+Refinement with Gram Stain Results
+When a blood culture becomes positive, the Gram stain provides an initial and crucial first stratification (Gram-positive vs. Gram-negative).
+Definitive Therapy Based on Species Identification
+After cultivation of the pathogen, full pathogen identification allows precise targeting of therapy.
+
By structuring antibiograms around this stepped approach, clinicians can make data-driven adjustments at each stage, ensuring optimal empirical and targeted therapy while reducing unnecessary broad-spectrum antimicrobial use.
+
+
+
+
Inclusion in Combination Antibiograms
+
+
+
Note that for combination antibiograms, it is important to realise that susceptibility can be calculated in two ways, which can be set with the only_all_tested
argument (default is FALSE
). See this example for two antimicrobials, Drug A and Drug B, about how antibiogram()
works to calculate the %SI:
--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE
----------------------- -----------------------
- Drug A Drug B include as include as include as include as
- numerator denominator numerator denominator
--------- -------- ---------- ----------- ---------- -----------
- S or I S or I X X X X
- R S or I X X X X
- <NA> S or I X X - -
- S or I R X X X X
- R R - X - X
- <NA> R - - - -
- S or I <NA> X X - -
- R <NA> - - - -
- <NA> <NA> - - - -
+ Drug A Drug B considered considered considered considered
+ susceptible tested susceptible tested
+-------- -------- ----------- ---------- ----------- ----------
+ S or I S or I X X X X
+ R S or I X X X X
+ <NA> S or I X X - -
+ S or I R X X X X
+ R R - X - X
+ <NA> R - - - -
+ S or I <NA> X X - -
+ R <NA> - - - -
+ <NA> <NA> - - - -
--------------------------------------------------------------------
@@ -301,7 +345,7 @@ Adhering to previously described approaches (see Source) and especially the Baye