Files
AMR/reference/antibiogram.html
T

841 lines
127 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Generate Antibiograms (WISCA, Traditional, Combination, or Syndromic) — antibiogram • AMR (for R)</title><!-- favicons --><link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png"><link rel="icon" type="”image/svg+xml”" href="../favicon.svg"><link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png"><link rel="icon" sizes="any" href="../favicon.ico"><link rel="manifest" href="../site.webmanifest"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.8/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.8/bootstrap.bundle.min.js"></script><link href="../deps/Lato-0.4.10/font.css" rel="stylesheet"><link href="../deps/Fira_Code-0.4.10/font.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet"><script src="../extra.js"></script><meta property="og:title" content="Generate Antibiograms (WISCA, Traditional, Combination, or Syndromic) — antibiogram"><meta name="description" content="Generate antibiograms from antimicrobial susceptibility data, with support for traditional, combination, syndromic, and WISCA (Weighted-Incidence Syndromic Combination Antibiogram) methods.
For empirical therapy guidance, WISCA is the recommended approach. When initiating empirical treatment, the causative pathogen is unknown, and the clinically relevant question is: &quot;what is the probability that this regimen will cover whatever pathogen turns out to cause the infection?&quot; WISCA answers that question directly by weighting susceptibility by pathogen incidence within a syndrome and providing credible intervals via Bayesian Monte Carlo simulation. Traditional antibiograms remain appropriate for tracking resistance per species for surveillance purposes. See the section Explaining WISCA on this page and the WISCA vignette for details.
All antibiogram types adhere to previously described approaches (see Source), and the WISCA method implements the Bayesian decision model by Bielicki et al. (2016, doi:10.1093/jac/dkv397
). Output formats include plots and tables, ideal for integration with R Markdown and Quarto reports."><meta property="og:description" content="Generate antibiograms from antimicrobial susceptibility data, with support for traditional, combination, syndromic, and WISCA (Weighted-Incidence Syndromic Combination Antibiogram) methods.
For empirical therapy guidance, WISCA is the recommended approach. When initiating empirical treatment, the causative pathogen is unknown, and the clinically relevant question is: &quot;what is the probability that this regimen will cover whatever pathogen turns out to cause the infection?&quot; WISCA answers that question directly by weighting susceptibility by pathogen incidence within a syndrome and providing credible intervals via Bayesian Monte Carlo simulation. Traditional antibiograms remain appropriate for tracking resistance per species for surveillance purposes. See the section Explaining WISCA on this page and the WISCA vignette for details.
All antibiogram types adhere to previously described approaches (see Source), and the WISCA method implements the Bayesian decision model by Bielicki et al. (2016, doi:10.1093/jac/dkv397
). Output formats include plots and tables, ideal for integration with R Markdown and Quarto reports."><meta property="og:image" content="https://amr-for-r.org/logo.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script></head><body>
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
<nav class="navbar navbar-expand-lg fixed-top bg-primary" data-bs-theme="dark" aria-label="Site navigation"><div class="container">
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse ms-3">
<ul class="navbar-nav me-auto"><li class="active nav-item dropdown">
<button class="nav-link dropdown-toggle" type="button" id="dropdown-how-to" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span class="fa fa-question-circle"></span> How to</button>
<ul class="dropdown-menu" aria-labelledby="dropdown-how-to"><li><a class="dropdown-item" href="../articles/AMR.html"><span class="fa fa-directions"></span> Conduct AMR Analysis</a></li>
<li><a class="dropdown-item" href="../reference/antibiogram.html"><span class="fa fa-file-prescription"></span> Generate Antibiogram (Trad./Syndromic/WISCA)</a></li>
<li><a class="dropdown-item" href="../articles/AMR_with_tidymodels.html"><span class="fa fa-square-root-variable"></span> Use AMR for Predictive Modelling (tidymodels)</a></li>
<li><a class="dropdown-item" href="../articles/datasets.html"><span class="fa fa-database"></span> Download Data Sets for Own Use</a></li>
<li><a class="dropdown-item" href="../reference/AMR-options.html"><span class="fa fa-gear"></span> Set User- Or Team-specific Package Settings</a></li>
<li><a class="dropdown-item" href="../articles/PCA.html"><span class="fa fa-compress"></span> Conduct Principal Component Analysis for AMR</a></li>
<li><a class="dropdown-item" href="../reference/mdro.html"><span class="fa fa-skull-crossbones"></span> Determine Multi-Drug Resistance (MDR)</a></li>
<li><a class="dropdown-item" href="../articles/WHONET.html"><span class="fa fa-globe-americas"></span> Work with WHONET Data</a></li>
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply EUCAST Rules</a></li>
<li><a class="dropdown-item" href="../reference/mo_property.html"><span class="fa fa-bug"></span> Get Taxonomy of a Microorganism</a></li>
<li><a class="dropdown-item" href="../reference/ab_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antibiotic Drug</a></li>
<li><a class="dropdown-item" href="../reference/av_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antiviral Drug</a></li>
</ul></li>
<li class="nav-item"><a class="nav-link" href="../articles/AMR_for_Python.html"><span class="fa fab fa-python"></span> AMR for Python</a></li>
<li class="nav-item"><a class="nav-link" href="../reference/index.html"><span class="fa fa-book-open"></span> Manual</a></li>
<li class="nav-item"><a class="nav-link" href="../authors.html"><span class="fa fa-users"></span> Authors</a></li>
</ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
<li class="nav-item"><a class="nav-link" href="../news/index.html"><span class="fa fa-newspaper"></span> Changelog</a></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/msberends/AMR"><span class="fa fa-github"></span> Source Code</a></li>
</ul></div>
</div>
</nav><div class="container template-reference-topic">
<div class="row">
<main id="main" class="col-md-9"><div class="page-header">
<img src="../logo.svg" class="logo" alt=""><h1>Generate Antibiograms (WISCA, Traditional, Combination, or Syndromic)</h1>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/antibiogram.R" class="external-link"><code>R/antibiogram.R</code></a></small>
<div class="d-none name"><code>antibiogram.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Generate antibiograms from antimicrobial susceptibility data, with support for traditional, combination, syndromic, and WISCA (Weighted-Incidence Syndromic Combination Antibiogram) methods.</p>
<p><strong>For empirical therapy guidance, WISCA is the recommended approach.</strong> When initiating empirical treatment, the causative pathogen is unknown, and the clinically relevant question is: <em>"what is the probability that this regimen will cover whatever pathogen turns out to cause the infection?"</em> WISCA answers that question directly by weighting susceptibility by pathogen incidence within a syndrome and providing credible intervals via Bayesian Monte Carlo simulation. Traditional antibiograms remain appropriate for tracking resistance per species for surveillance purposes. See the section <em>Explaining WISCA</em> on this page and the <a href="https://amr-for-r.org/articles/WISCA.html">WISCA vignette</a> for details.</p>
<p>All antibiogram types adhere to previously described approaches (see <em>Source</em>), and the WISCA method implements the Bayesian decision model by Bielicki <em>et al.</em> (2016, <a href="https://doi.org/10.1093/jac/dkv397" class="external-link">doi:10.1093/jac/dkv397</a>
). Output formats include plots and tables, ideal for integration with R Markdown and Quarto reports.</p>
</div>
<div class="section level2">
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">wisca</span><span class="op">(</span></span>
<span> <span class="va">x</span>,</span>
<span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://tidyselect.r-lib.org/reference/where.html" class="external-link">where</a></span><span class="op">(</span><span class="va">is.sir</span><span class="op">)</span>,</span>
<span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span>
<span> syndromic_group <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> only_all_tested <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> digits <span class="op">=</span> <span class="fl">1</span>,</span>
<span> formatting_type <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_antibiogram_formatting_type"</span>, <span class="fl">14</span><span class="op">)</span>,</span>
<span> col_mo <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> language <span class="op">=</span> <span class="fu"><a href="translate.html">get_AMR_locale</a></span><span class="op">(</span><span class="op">)</span>,</span>
<span> <span class="va">combine_SI</span>,</span>
<span> guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>, <span class="st">"EUCAST"</span><span class="op">)</span>,</span>
<span> sep <span class="op">=</span> <span class="st">" + "</span>,</span>
<span> sort_columns <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> simulations <span class="op">=</span> <span class="fl">1000</span>,</span>
<span> conf_interval <span class="op">=</span> <span class="fl">0.95</span>,</span>
<span> interval_side <span class="op">=</span> <span class="st">"two-tailed"</span>,</span>
<span> info <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span>,</span>
<span> parallel <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">antibiogram</span><span class="op">(</span></span>
<span> <span class="va">x</span>,</span>
<span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://tidyselect.r-lib.org/reference/where.html" class="external-link">where</a></span><span class="op">(</span><span class="va">is.sir</span><span class="op">)</span>,</span>
<span> mo_transform <span class="op">=</span> <span class="st">"shortname"</span>,</span>
<span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span>
<span> syndromic_group <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> add_total_n <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> only_all_tested <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> digits <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">wisca</span>, <span class="fl">1</span>, <span class="fl">0</span><span class="op">)</span>,</span>
<span> formatting_type <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_antibiogram_formatting_type"</span>, <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">wisca</span>, <span class="fl">14</span>, <span class="fl">18</span><span class="op">)</span><span class="op">)</span>,</span>
<span> col_mo <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> language <span class="op">=</span> <span class="fu"><a href="translate.html">get_AMR_locale</a></span><span class="op">(</span><span class="op">)</span>,</span>
<span> minimum <span class="op">=</span> <span class="fl">30</span>,</span>
<span> <span class="va">combine_SI</span>,</span>
<span> guideline <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"AMR_guideline"</span>, <span class="st">"EUCAST"</span><span class="op">)</span>,</span>
<span> sep <span class="op">=</span> <span class="st">" + "</span>,</span>
<span> sort_columns <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> wisca <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> simulations <span class="op">=</span> <span class="fl">1000</span>,</span>
<span> conf_interval <span class="op">=</span> <span class="fl">0.95</span>,</span>
<span> interval_side <span class="op">=</span> <span class="st">"two-tailed"</span>,</span>
<span> info <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span>,</span>
<span> parallel <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">retrieve_wisca_parameters</span><span class="op">(</span><span class="va">wisca_model</span>, <span class="va">...</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># S3 method for class 'antibiogram'</span></span>
<span><span class="fu"><a href="plot.html">plot</a></span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># S3 method for class 'antibiogram'</span></span>
<span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span></span>
<span> <span class="va">object</span>,</span>
<span> geom <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"pointrange"</span>, <span class="st">"point"</span>, <span class="st">"col"</span>, <span class="st">"bar"</span>, <span class="st">"errorbar"</span><span class="op">)</span>,</span>
<span> ci <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> sort <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> flip <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> caption <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">wisca_plot</span><span class="op">(</span></span>
<span> <span class="va">wisca_model</span>,</span>
<span> wisca_plot_type <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"susceptibility_incidence"</span>, <span class="st">"posterior_coverage"</span><span class="op">)</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="co"># S3 method for class 'antibiogram'</span></span>
<span><span class="fu">knit_print</span><span class="op">(</span></span>
<span> <span class="va">x</span>,</span>
<span> italicise <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> na <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"knitr.kable.NA"</span>, default <span class="op">=</span> <span class="st">""</span><span class="op">)</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
<dl><dt id="arg-x">x<a class="anchor" aria-label="anchor" href="#arg-x"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> containing at least a column with microorganisms and columns with antimicrobial results (class 'sir', see <code><a href="as.sir.html">as.sir()</a></code>).</p></dd>
<dt id="arg-antimicrobials">antimicrobials<a class="anchor" aria-label="anchor" href="#arg-antimicrobials"></a></dt>
<dd><p>A vector specifying the antimicrobials containing SIR values to include in the antibiogram (see <em>Examples</em>). Will be evaluated using <code><a href="guess_ab_col.html">guess_ab_col()</a></code>. This can be:</p><ul><li><p>Any antimicrobial name or code that could match (see <code><a href="guess_ab_col.html">guess_ab_col()</a></code>) to any column in <code>x</code></p></li>
<li><p>Any <a href="antimicrobial_selectors.html">antimicrobial selector</a>, such as <code><a href="antimicrobial_selectors.html">aminoglycosides()</a></code> or <code><a href="antimicrobial_selectors.html">carbapenems()</a></code></p></li>
<li><p>A combination of the above, using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>, e.g.:</p><ul><li><p><code>c(aminoglycosides(), "AMP", "AMC")</code></p></li>
<li><p><code>c(aminoglycosides(), carbapenems())</code></p></li>
</ul></li>
<li><p>Column indices using numbers</p></li>
<li><p>Combination therapy, indicated by using <code>"+"</code>, with or without <a href="antimicrobial_selectors.html">antimicrobial selectors</a>, e.g.:</p><ul><li><p><code>"cipro + genta"</code></p></li>
<li><p><code>"TZP+TOB"</code></p></li>
<li><p><code>c("TZP", "TZP+GEN", "TZP+TOB")</code></p></li>
<li><p><code>carbapenems() + "GEN"</code></p></li>
<li><p><code>carbapenems() + c("", "GEN")</code></p></li>
<li><p><code>carbapenems() + c("", aminoglycosides())</code></p></li>
</ul></li>
</ul></dd>
<dt id="arg-ab-transform">ab_transform<a class="anchor" aria-label="anchor" href="#arg-ab-transform"></a></dt>
<dd><p>A character to transform antimicrobial input - must be one of the column names of the <a href="antimicrobials.html">antimicrobials</a> data set (defaults to <code>"name"</code>): <code>"ab"</code>, <code>"cid"</code>, <code>"name"</code>, <code>"group"</code>, <code>"atc"</code>, <code>"atc_group1"</code>, <code>"atc_group2"</code>, <code>"abbreviations"</code>, <code>"synonyms"</code>, <code>"oral_ddd"</code>, <code>"oral_units"</code>, <code>"iv_ddd"</code>, <code>"iv_units"</code>, or <code>"loinc"</code>. Can also be <code>NULL</code> to not transform the input.</p></dd>
<dt id="arg-syndromic-group">syndromic_group<a class="anchor" aria-label="anchor" href="#arg-syndromic-group"></a></dt>
<dd><p>A column name of <code>x</code>, or values calculated to split rows of <code>x</code>, e.g. by using <code><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse()</a></code> or <code><a href="https://dplyr.tidyverse.org/reference/case-and-replace-when.html" class="external-link">case_when()</a></code>. See <em>Examples</em>.</p></dd>
<dt id="arg-only-all-tested">only_all_tested<a class="anchor" aria-label="anchor" href="#arg-only-all-tested"></a></dt>
<dd><p>(for combination antibiograms): a <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate that isolates must be tested for all antimicrobials, see <em>Details</em>.</p></dd>
<dt id="arg-digits">digits<a class="anchor" aria-label="anchor" href="#arg-digits"></a></dt>
<dd><p>Number of digits to use for rounding the antimicrobial coverage, defaults to 1 for WISCA and 0 otherwise.</p></dd>
<dt id="arg-formatting-type">formatting_type<a class="anchor" aria-label="anchor" href="#arg-formatting-type"></a></dt>
<dd><p>Numeric value (1-22 for WISCA, 1-12 for non-WISCA) indicating how the 'cells' of the antibiogram table should be formatted. See <em>Details</em> &gt; <em>Formatting Type</em> for a list of options.</p></dd>
<dt id="arg-col-mo">col_mo<a class="anchor" aria-label="anchor" href="#arg-col-mo"></a></dt>
<dd><p>Column name of the names or codes of the microorganisms (see <code><a href="as.mo.html">as.mo()</a></code>) - the default is the first column of class <code><a href="as.mo.html">mo</a></code>. Values will be coerced using <code><a href="as.mo.html">as.mo()</a></code>.</p></dd>
<dt id="arg-language">language<a class="anchor" aria-label="anchor" href="#arg-language"></a></dt>
<dd><p>Language to translate text, which defaults to the system language (see <code><a href="translate.html">get_AMR_locale()</a></code>).</p></dd>
<dt id="arg-combine-si">combine_SI<a class="anchor" aria-label="anchor" href="#arg-combine-si"></a></dt>
<dd><p><em>(deprecated in favour of <code>guideline</code>)</em> A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a>. If set, it takes precedence over <code>guideline</code>: <code>TRUE</code> considers S, SDD, and I susceptible, and <code>FALSE</code> only S.</p></dd>
<dt id="arg-guideline">guideline<a class="anchor" aria-label="anchor" href="#arg-guideline"></a></dt>
<dd><p>A guideline name, <code>"EUCAST"</code> or <code>"CLSI"</code> (or any version thereof, e.g. <code>"CLSI 2025"</code>), to determine whether the 'I' category is considered susceptible (EUCAST) or resistant (CLSI). 'SDD' is always considered susceptible. The default is the package option <code><a href="AMR-options.html">AMR_guideline</a></code>, or <code>"EUCAST"</code> if it is not set. See section <em>Interpretation of SIR</em> below.</p></dd>
<dt id="arg-sep">sep<a class="anchor" aria-label="anchor" href="#arg-sep"></a></dt>
<dd><p>A separating character for antimicrobial columns in combination antibiograms.</p></dd>
<dt id="arg-sort-columns">sort_columns<a class="anchor" aria-label="anchor" href="#arg-sort-columns"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the antimicrobial columns must be sorted on name.</p></dd>
<dt id="arg-simulations">simulations<a class="anchor" aria-label="anchor" href="#arg-simulations"></a></dt>
<dd><p>(for WISCA) a numerical value to set the number of Monte Carlo simulations.</p></dd>
<dt id="arg-conf-interval">conf_interval<a class="anchor" aria-label="anchor" href="#arg-conf-interval"></a></dt>
<dd><p>A numerical value to set confidence interval (default is <code>0.95</code>).</p></dd>
<dt id="arg-interval-side">interval_side<a class="anchor" aria-label="anchor" href="#arg-interval-side"></a></dt>
<dd><p>The side of the confidence interval, either <code>"two-tailed"</code> (default), <code>"left"</code> or <code>"right"</code>.</p></dd>
<dt id="arg-info">info<a class="anchor" aria-label="anchor" href="#arg-info"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate info should be printed - the default is <code>TRUE</code> only in interactive mode.</p></dd>
<dt id="arg-parallel">parallel<a class="anchor" aria-label="anchor" href="#arg-parallel"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if parallel computing must be used, defaults to <code>FALSE</code>. Requires the <code><a href="https://future.apply.futureverse.org/reference/future_lapply.html" class="external-link">future.apply</a></code> package. For WISCA, Monte Carlo simulations are distributed across workers; for grouped antibiograms, each group is processed by a separate worker. <strong>A non-sequential <code><a href="https://future.futureverse.org/reference/plan.html" class="external-link">future::plan()</a></code> must already be active before setting <code>parallel = TRUE</code></strong> – for example, <code>future::plan(future::multisession)</code>. An error is thrown if <code>parallel = TRUE</code> is used without a plan set by the user.</p></dd>
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
<dd><p>Currently unused.</p></dd>
<dt id="arg-mo-transform">mo_transform<a class="anchor" aria-label="anchor" href="#arg-mo-transform"></a></dt>
<dd><p>A character to transform microorganism input - must be <code>"name"</code>, <code>"shortname"</code> (default), <code>"gramstain"</code>, or one of the column names of the <a href="microorganisms.html">microorganisms</a> data set: <code>"mo"</code>, <code>"fullname"</code>, <code>"status"</code>, <code>"domain"</code>, <code>"kingdom"</code>, <code>"phylum"</code>, <code>"class"</code>, <code>"order"</code>, <code>"family"</code>, <code>"genus"</code>, <code>"species"</code>, <code>"subspecies"</code>, <code>"rank"</code>, <code>"ref"</code>, <code>"oxygen_tolerance"</code>, <code>"morphology"</code>, <code>"source"</code>, <code>"lpsn"</code>, <code>"lpsn_parent"</code>, <code>"lpsn_renamed_to"</code>, <code>"mycobank"</code>, <code>"mycobank_parent"</code>, <code>"mycobank_renamed_to"</code>, <code>"gbif"</code>, <code>"gbif_parent"</code>, <code>"gbif_renamed_to"</code>, <code>"prevalence"</code>, or <code>"snomed"</code>. Can also be <code>NULL</code> to not transform the input or <code>NA</code> to consider all microorganisms 'unknown'.</p></dd>
<dt id="arg-add-total-n">add_total_n<a class="anchor" aria-label="anchor" href="#arg-add-total-n"></a></dt>
<dd><p><em>(deprecated in favour of <code>formatting_type</code>)</em> A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether <code>n_tested</code> available numbers per pathogen should be added to the table (default is <code>TRUE</code>). This will add the lowest and highest number of available isolates per antimicrobial (e.g., if for <em>E. coli</em> 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when <code>wisca = TRUE</code>; in that case, use <code>retrieve_wisca_parameters()</code> to get the parameters used for WISCA.</p></dd>
<dt id="arg-minimum">minimum<a class="anchor" aria-label="anchor" href="#arg-minimum"></a></dt>
<dd><p>The minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see <em>Source</em>.</p></dd>
<dt id="arg-wisca">wisca<a class="anchor" aria-label="anchor" href="#arg-wisca"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) must be generated (default is <code>FALSE</code>). This will use a Bayesian decision model to estimate regimen coverage probabilities using <a href="https://en.wikipedia.org/wiki/Monte_Carlo_method" class="external-link">Monte Carlo simulations</a>. Per <a href="https://doi.org/10.1093/jac/dkv397" class="external-link">doi:10.1093/jac/dkv397</a>
, susceptibility priors are \(\beta(0.5, 0.5)\) (Jeffreys) and intrinsically resistant pairs (based on <a href="intrinsic_resistant.html">intrinsic_resistant</a>) use \(\beta(1, 9999)\).</p>
<p>Set <code>simulations</code>, <code>conf_interval</code>, and <code>interval_side</code> to adjust.</p></dd>
<dt id="arg-wisca-model">wisca_model<a class="anchor" aria-label="anchor" href="#arg-wisca-model"></a></dt>
<dd><p>The outcome of <code>wisca()</code> or <code>antibiogram(..., wisca = TRUE)</code>.</p></dd>
<dt id="arg-object">object<a class="anchor" aria-label="anchor" href="#arg-object"></a></dt>
<dd><p>An <code>antibiogram()</code> object.</p></dd>
<dt id="arg-geom">geom<a class="anchor" aria-label="anchor" href="#arg-geom"></a></dt>
<dd><p>The plotting style for the point estimate. One of <code>"pointrange"</code> (default), <code>"point"</code>, <code>"col"</code>/<code>"bar"</code>, or <code>"errorbar"</code>. <code>"pointrange"</code> is recommended for coverage data: bars imply a meaningful baseline at zero, which coverage estimates rarely have.</p></dd>
<dt id="arg-ci">ci<a class="anchor" aria-label="anchor" href="#arg-ci"></a></dt>
<dd><p>Logical, whether to draw the credible/confidence interval. Defaults to <code>TRUE</code>. Ignored (forced <code>TRUE</code>) when <code>geom = "pointrange"</code> or <code>"errorbar"</code>, since the interval is intrinsic to those geoms.</p></dd>
<dt id="arg-sort">sort<a class="anchor" aria-label="anchor" href="#arg-sort"></a></dt>
<dd><p>Logical, whether to order regimens by coverage. Defaults to <code>TRUE</code>. When faceted (per pathogen) or grouped (syndromic), ordering is applied within each panel/group.</p></dd>
<dt id="arg-flip">flip<a class="anchor" aria-label="anchor" href="#arg-flip"></a></dt>
<dd><p>Logical, whether to draw regimens on the y-axis (horizontal). Defaults to <code>NULL</code>, which flips automatically when any regimen label exceeds 20 characters (long combination names read poorly on the x-axis). Set <code>TRUE</code>/<code>FALSE</code> to override.</p></dd>
<dt id="arg-caption">caption<a class="anchor" aria-label="anchor" href="#arg-caption"></a></dt>
<dd><p>Text to show as caption, will explain non-inferiority for WISCA models.</p></dd>
<dt id="arg-wisca-plot-type">wisca_plot_type<a class="anchor" aria-label="anchor" href="#arg-wisca-plot-type"></a></dt>
<dd><p>Either <code>"susceptibility_incidence"</code> (default) or <code>"posterior_coverage"</code>.</p></dd>
<dt id="arg-italicise">italicise<a class="anchor" aria-label="anchor" href="#arg-italicise"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether the microorganism names in the <a href="https://rdrr.io/pkg/knitr/man/kable.html" class="external-link">knitr</a> table should be made italic, using <code><a href="italicise_taxonomy.html">italicise_taxonomy()</a></code>.</p></dd>
<dt id="arg-na">na<a class="anchor" aria-label="anchor" href="#arg-na"></a></dt>
<dd><p>Character to use for showing <code>NA</code> values.</p></dd>
</dl></div>
<div class="section level2">
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
<p>These functions return a table with values between 0 and 100 for <em>susceptibility</em>, not resistance.</p>
<p><strong>Remember that you should filter your data to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href="first_isolate.html">first_isolate()</a></code> to determine them with one of the four available algorithms: isolate-based, patient-based, episode-based, or phenotype-based.</p>
<p>For estimating antimicrobial coverage, especially when creating a WISCA, the outcome might become more reliable by only including the top <em>n</em> species encountered in the data. You can filter on this top <em>n</em> using <code><a href="top_n_microorganisms.html">top_n_microorganisms()</a></code>. For example, use <code>top_n_microorganisms(your_data, n = 10)</code> as a pre-processing step to only include the top 10 species in the data.</p>
<p>The numeric values of an antibiogram are stored in a long format as the <a href="https://rdrr.io/r/base/attributes.html" class="external-link">attribute</a> <code>long_numeric</code>. You can retrieve them using <code>attributes(x)$long_numeric</code>, where <code>x</code> is the outcome of <code>antibiogram()</code> or <code>wisca()</code>. This is ideal for e.g. advanced plotting.</p><div class="section">
<h3 id="formatting-type">Formatting Type<a class="anchor" aria-label="anchor" href="#formatting-type"></a></h3>
<p>The formatting of the 'cells' of the table can be set with the argument <code>formatting_type</code>. In these examples, <code>5</code> indicates the antimicrobial coverage (<code>4-6</code> the confidence level), <code>15</code> the number of susceptible isolates, and <code>300</code> the number of tested (i.e., available) isolates:</p><ol><li><p>5</p></li>
<li><p>15</p></li>
<li><p>300</p></li>
<li><p>15/300</p></li>
<li><p>5 (300)</p></li>
<li><p>5% (300)</p></li>
<li><p>5 (N=300)</p></li>
<li><p>5% (N=300)</p></li>
<li><p>5 (15/300)</p></li>
<li><p>5% (15/300)</p></li>
<li><p>5 (N=15/300)</p></li>
<li><p>5% (N=15/300)</p></li>
<li><p>5 (4-6)</p></li>
<li><p>5% (4-6%) - <strong>default for WISCA</strong></p></li>
<li><p>5 (4-6,300)</p></li>
<li><p>5% (4-6%,300)</p></li>
<li><p>5 (4-6,N=300)</p></li>
<li><p>5% (4-6%,N=300) - <strong>default for non-WISCA</strong></p></li>
<li><p>5 (4-6,15/300)</p></li>
<li><p>5% (4-6%,15/300)</p></li>
<li><p>5 (4-6,N=15/300)</p></li>
<li><p>5% (4-6%,N=15/300)</p></li>
</ol><p>The default can be set globally with the package option <code><a href="AMR-options.html">AMR_antibiogram_formatting_type</a></code>, e.g. <code>options(AMR_antibiogram_formatting_type = 5)</code>. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level.</p>
<p>Set <code>digits</code> (defaults to <code>0</code>) to alter the rounding of the susceptibility percentages.</p>
</div>
<div class="section">
<h3 id="when-to-use-wisca-vs-traditional-antibiograms">When to Use WISCA vs. Traditional Antibiograms<a class="anchor" aria-label="anchor" href="#when-to-use-wisca-vs-traditional-antibiograms"></a></h3>
<p>There are various antibiogram types, as summarised by Klinker <em>et al.</em> (2021, <a href="https://doi.org/10.1177/20499361211011373" class="external-link">doi:10.1177/20499361211011373</a>
), and they are all supported by <code>antibiogram()</code>: traditional, combination, syndromic, and WISCA.</p>
<p><strong>If your goal is to guide empirical therapy, use WISCA.</strong> Traditional antibiograms fragment susceptibility information by species, but at the point of prescribing, the clinician does not know which species is causing the infection. WISCA shifts the unit of analysis from the isolate to the patient: it estimates the probability that a regimen will cover the infection, given the local distribution of causative pathogens. It evaluates combination regimens, weights by pathogen incidence, and provides credible intervals that honestly communicate uncertainty. Hebert <em>et al.</em> (2012) demonstrated this concretely for the first time: ciprofloxacin showed 84% susceptibility against <em>E. coli</em> in the traditional antibiogram, but WISCA coverage was only 62% for UTI and 37% for abdominal infections, because other species (including intrinsically resistant enterococci) contribute substantially to these syndromes. Note that WISCA is pathogen-agnostic: the outcome is not stratified by species, but by syndrome.</p>
<p><strong>Traditional, combination, and syndromic antibiograms remain appropriate for AMR surveillance</strong>, i.e., tracking resistance trends per species over time. They are the right tool when the question is <em>"how resistant is species X to drug Y in our setting?"</em> rather than <em>"what regimen best covers this syndrome?"</em>.</p>
<p>All four types are demonstrated in the <em>Examples</em> section below.</p>
</div>
<div class="section">
<h3 id="grouped-tibbles">Grouped tibbles<a class="anchor" aria-label="anchor" href="#grouped-tibbles"></a></h3>
<p>For any type of antibiogram, grouped <a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibbles</a> can also be used to calculate susceptibilities over various groups.</p>
<p>Code example:</p>
<p></p><div class="sourceCode r"><pre><code><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org" class="external-link">dplyr</a></span><span class="op">)</span></span>
<span><span class="va">your_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span>
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">has_sepsis</span>, <span class="va">is_neonate</span>, <span class="va">sex</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span>
<span> <span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span>antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span><span class="op">)</span></span></code></pre><p></p></div>
</div>
<div class="section">
<h3 id="inclusion-in-combination-antibiograms">Inclusion in Combination Antibiograms<a class="anchor" aria-label="anchor" href="#inclusion-in-combination-antibiograms"></a></h3>
<p>For combination antibiograms, the results of the antimicrobials are combined using the same rules as <code><a href="sir_combine.html">sir_combine()</a></code>, see the section <em>Combination Therapy</em> below. Whether isolates must be tested for all antimicrobials can be set with the <code>only_all_tested</code> argument (default is <code>FALSE</code>). Whether the 'I' category is considered susceptible follows the <code>guideline</code> argument, which also determines whether a missing result can be ignored. To use a combination in other analyses as well, create a new variable with <code><a href="sir_combine.html">sir_combine()</a></code>.</p>
</div>
<div class="section">
<h3 id="plotting">Plotting<a class="anchor" aria-label="anchor" href="#plotting"></a></h3>
<p>All types of antibiograms as listed above can be plotted (using <code><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">ggplot2::autoplot()</a></code> or base <span style="R">R</span>'s <code><a href="plot.html">plot()</a></code> and <code><a href="https://rdrr.io/r/graphics/barplot.html" class="external-link">barplot()</a></code>). As mentioned above, the numeric values of an antibiogram are stored in a long format as the <a href="https://rdrr.io/r/base/attributes.html" class="external-link">attribute</a> <code>long_numeric</code>. You can retrieve them using <code>attributes(x)$long_numeric</code>, where <code>x</code> is the outcome of <code>antibiogram()</code> or <code>wisca()</code>.</p>
<p>The outcome of <code>antibiogram()</code> can also be used directly in R Markdown / Quarto (i.e., <code>knitr</code>) for reports. In this case, <code><a href="https://rdrr.io/pkg/knitr/man/kable.html" class="external-link">knitr::kable()</a></code> will be applied automatically and microorganism names will even be printed in italics at default (see argument <code>italicise</code>).</p>
<p>You can also use functions from specific 'table reporting' packages to transform the output of <code>antibiogram()</code> to your needs, e.g. with <code>flextable::as_flextable()</code> or <code>gt::gt()</code>.</p>
</div>
</div>
<div class="section level2">
<h2 id="explaining-wisca">Explaining WISCA<a class="anchor" aria-label="anchor" href="#explaining-wisca"></a></h2>
<p>WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability that an empirical antimicrobial regimen will provide adequate coverage for a given infection syndrome, before the causative pathogen has been identified.</p>
<p>It does so by combining two quantities: the relative incidence of each pathogen within the syndrome (modelled as a Dirichlet distribution) and the susceptibility of each pathogen to the regimen (modelled as Beta distributions). These are combined via Monte Carlo simulation to produce a coverage estimate with a credible interval.</p>
<p><strong>Prior distributions:</strong> Pathogen incidence uses a non-informative \(Dirichlet(1, 1, \ldots, 1)\) prior. Susceptibility proportions use the Jeffreys prior, \(\beta(0.5, 0.5)\), except for pathogen-drug combinations with known intrinsic resistance, which use a strongly informative \(\beta(1, 9999)\) prior that forces near-zero susceptibility regardless of observed data. Intrinsic resistance is determined using the <a href="intrinsic_resistant.html">intrinsic_resistant</a> data set, which is based on <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expected Resistant Phenotypes' v1.2</a> (2023).</p>
<p><strong>Pathogens included in the model:</strong> For each regimen (and group), only pathogens that occur in the data and have at least one test result for the regimen are included. Pathogens without any test result for a regimen do not contribute to its coverage, nor to its <code>n_total</code> in <code>long_numeric</code>. Use <code>retrieve_wisca_parameters()</code> to get the parameters that were used.</p>
<p><strong>Rare pathogens and small groups:</strong> Since every pathogen receives a prior weight of 1 in the Dirichlet distribution, the prior weighs heavily when there are few isolates relative to the number of pathogens, i.e., with pathogens found only once or a few times, or in small groups. This pulls the incidence towards a uniform distribution, and the very uncertain susceptibility of rare pathogens can then strongly lower the estimated coverage, without reflecting the clinical expectation. A warning is therefore given when this prior weight accounts for more than 5% of the pathogen incidence in any regimen (or group). Consider limiting the analysis to the most common pathogens using <code><a href="top_n_microorganisms.html">top_n_microorganisms()</a></code>, or using fewer and larger groups.</p>
<p><strong>Interpreting the output:</strong> Overlapping credible intervals between regimens indicate no significant difference in coverage; if a narrower-spectrum regimen overlaps with a broader one, the narrower-spectrum option may be preferred on stewardship grounds. Non-overlapping intervals indicate a clinically meaningful difference. For small sample sizes, consider pooling data from multiple sites to improve precision, provided pathogen distributions are sufficiently similar (Bielicki <em>et al.</em>, 2016).</p>
<p>For the full mathematical derivation and worked examples, see the <a href="https://amr-for-r.org/articles/WISCA.html">WISCA vignette</a>.</p>
</div>
<div class="section level2">
<h2 id="combination-therapy">Combination Therapy<a class="anchor" aria-label="anchor" href="#combination-therapy"></a></h2>
<p>Results are ordered from susceptible to resistant: S (and WT), SDD, I, R (and NWT, NS). With <code>method = "most_susceptible"</code> (in <code><a href="sir_combine.html">sir_combine()</a></code>), the most susceptible result of the antimicrobials is returned, and with <code>method = "most_resistant"</code>, the most resistant result. The value <code>"NI"</code> (non-interpretable) is considered a missing result.</p>
<p>A missing result can only be ignored if it cannot change the conclusion: a susceptible result for <code>"most_susceptible"</code>, and a non-susceptible result for <code>"most_resistant"</code>. Under EUCAST, the 'I' category is considered susceptible (<em>susceptible, increased exposure</em>), and under CLSI, it is not. With <code>only_all_tested = TRUE</code>, any missing result leads to <code>NA</code>.</p>
<p>This is an example for two antimicrobials, Drug A and Drug B, under EUCAST (the order of the antimicrobials does not matter):</p>
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="sc">-------------------------------------------------------------------------</span></span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> Result of method <span class="ot">=</span> Result of method <span class="ot">=</span></span>
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a> <span class="st">"most_susceptible"</span> <span class="st">"most_resistant"</span></span>
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a> <span class="sc">-----------------------</span> <span class="sc">-----------------------------</span></span>
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a> only_all_tested <span class="ot">=</span> only_all_tested <span class="ot">=</span></span>
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a> Drug A Drug B <span class="cn">FALSE</span> <span class="cn">TRUE</span> <span class="cn">FALSE</span> <span class="cn">TRUE</span></span>
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a><span class="sc">--------</span> <span class="sc">--------</span> <span class="sc">---------</span> <span class="sc">---------</span> <span class="sc">-----------</span> <span class="sc">-------------</span></span>
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a> S S S S S S</span>
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a> S I S S I I</span>
<span id="cb1-10"><a href="#cb1-10" tabindex="-1"></a> S R S S R R</span>
<span id="cb1-11"><a href="#cb1-11" tabindex="-1"></a> I R I I R R</span>
<span id="cb1-12"><a href="#cb1-12" tabindex="-1"></a> R R R R R R</span>
<span id="cb1-13"><a href="#cb1-13" tabindex="-1"></a> S <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> S <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span></span>
<span id="cb1-14"><a href="#cb1-14" tabindex="-1"></a> I <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> I <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span></span>
<span id="cb1-15"><a href="#cb1-15" tabindex="-1"></a> R <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> R <span class="sc">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span></span>
<span id="cb1-16"><a href="#cb1-16" tabindex="-1"></a> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span> <span class="er">&lt;</span><span class="cn">NA</span><span class="sc">&gt;</span></span>
<span id="cb1-17"><a href="#cb1-17" tabindex="-1"></a><span class="sc">-------------------------------------------------------------------------</span></span></code></pre><p></p></div>
<p>Under CLSI, the combination of I with a missing result is <code>&lt;NA&gt;</code> for <code>"most_susceptible"</code> and I for <code>"most_resistant"</code>.</p>
<p>The <code><a href="count.html">count_*()</a></code> and <code><a href="proportion.html">proportion_*()</a></code> functions apply these rules when more than one variable is used. With <code>only_all_tested = FALSE</code> (default), the functions for susceptibility, such as <code><a href="proportion.html">susceptibility()</a></code> and <code><a href="count.html">count_susceptible()</a></code>, count an isolate as susceptible if any of the antimicrobials is susceptible (<code>"most_susceptible"</code>), and the functions for resistance, such as <code><a href="proportion.html">resistance()</a></code> and <code><a href="count.html">count_resistant()</a></code>, count an isolate as resistant if any of the antimicrobials is resistant (<code>"most_resistant"</code>). An isolate is considered tested if it has such a result, or if it was tested for all antimicrobials. Therefore, for combinations with <code>only_all_tested = FALSE</code>:</p>
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a> <span class="fu">count_S</span>() <span class="sc">+</span> <span class="fu">count_I</span>() <span class="sc">+</span> <span class="fu">count_R</span>() <span class="sc">&gt;=</span> <span class="fu">count_all</span>()</span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> <span class="fu">proportion_S</span>() <span class="sc">+</span> <span class="fu">proportion_I</span>() <span class="sc">+</span> <span class="fu">proportion_R</span>() <span class="sc">&gt;=</span> <span class="dv">1</span></span></code></pre><p></p></div>
<p>With <code>only_all_tested = TRUE</code>, all these functions count the result of the combination therapy (<code>"most_susceptible"</code>) of isolates tested for all antimicrobials, so that:</p>
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a> <span class="fu">count_S</span>() <span class="sc">+</span> <span class="fu">count_I</span>() <span class="sc">+</span> <span class="fu">count_R</span>() <span class="ot">=</span> <span class="fu">count_all</span>()</span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> <span class="fu">proportion_S</span>() <span class="sc">+</span> <span class="fu">proportion_I</span>() <span class="sc">+</span> <span class="fu">proportion_R</span>() <span class="ot">=</span> <span class="dv">1</span></span></code></pre><p></p></div>
<p>In <code>antibiogram()</code> and <code>wisca()</code>, the result of the combination therapy (<code>"most_susceptible"</code>) is used, the 'I' category is considered susceptible or not following the <code>guideline</code> argument ('SDD' is always considered susceptible), and the result is then reduced to S or R.</p>
</div>
<div class="section level2">
<h2 id="interpretation-of-sir">Interpretation of SIR<a class="anchor" aria-label="anchor" href="#interpretation-of-sir"></a></h2>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I, and R (<a href="https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/" class="external-link">https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/</a>).</p>
<p>In aggregated analyses, such as proportions, counts, antibiograms, and plots, the 'I' category must be considered either susceptible or resistant. In epidemiological AMR data analysis, this follows the guideline: EUCAST considers 'I' susceptible, while CLSI considers 'I' resistant. The dose-dependent susceptibility of CLSI ('SDD') is always considered susceptible, as it equals what EUCAST defines as 'I'. All functions with a <code>guideline</code> argument for this purpose use these categories:</p><table class="table table"><tr><td><code>guideline</code></td><td>Susceptible</td><td>Resistant</td></tr><tr><td><code>"EUCAST"</code></td><td>S, SDD, I, WT</td><td>R, NWT, NS</td></tr><tr><td><code>"CLSI"</code></td><td>S, SDD, WT</td><td>I, R, NWT, NS</td></tr></table><p>The values 'WT' (wild type) and 'NWT' (non-wild type) result from epidemiological cut-off values (ECOFFs) instead of clinical breakpoints. Since they are no clinical categories, 'WT' is always considered susceptible and 'NWT' always resistant, regardless of the guideline. The value 'NS' (non-susceptible) is always considered resistant, and 'NI' (non-interpretable) is always considered a missing result.</p>
<p>The <code>guideline</code> argument can be:</p><ul><li><p><strong>Left unset</strong>, to use the package option <code><a href="AMR-options.html">AMR_guideline</a></code>, or <code>"EUCAST"</code> if this option is not set. In the latter case, a message is shown once per session (but not in R Markdown or Quarto documents); set the option to silence it.</p></li>
<li><p><strong><code>"EUCAST"</code></strong>, or any EUCAST version such as <code>"EUCAST 2025"</code>, to consider 'I' susceptible, e.g., to return <code>"SI"</code> vs. <code>"R"</code> in <code><a href="proportion.html">proportion_df()</a></code>.</p></li>
<li><p><strong><code>"CLSI"</code></strong>, or any CLSI version such as <code>"CLSI 2025"</code>, to consider 'I' resistant, e.g., to return <code>"S"</code> vs. <code>"IR"</code> in <code><a href="proportion.html">proportion_df()</a></code>.</p></li>
<li><p><strong><code>NULL</code> or <code>FALSE</code></strong>, to keep S, I, and R separate. This is only possible in functions that return results per category: <code><a href="count.html">count_df()</a></code>, <code><a href="proportion.html">proportion_df()</a></code>, <code><a href="proportion.html">sir_df()</a></code>, <code><a href="ggplot_sir.html">ggplot_sir()</a></code>, <code><a href="ggplot_sir.html">geom_sir()</a></code>, <code><a href="ggplot_sir.html">labels_sir_count()</a></code>, and <code><a href="bug_drug_combinations.html">bug_drug_combinations()</a></code>. Functions that return a single proportion or count, such as <code><a href="proportion.html">susceptibility()</a></code>, <code><a href="count.html">count_resistant()</a></code>, <code>antibiogram()</code>, <code>wisca()</code>, and <code><a href="https://rdrr.io/r/base/format.html" class="external-link">format()</a></code> on the result of <code><a href="bug_drug_combinations.html">bug_drug_combinations()</a></code>, require 'I' to be considered either susceptible or resistant, and return an error.</p></li>
</ul><p>Use <code><a href="proportion.html">susceptibility()</a></code> and <code><a href="proportion.html">resistance()</a></code> (or <code><a href="count.html">count_susceptible()</a></code> and <code><a href="count.html">count_resistant()</a></code>) to follow the guideline, or e.g. <code><a href="proportion.html">proportion_SI()</a></code> and <code><a href="proportion.html">proportion_R()</a></code> to be explicit regardless of the guideline.</p>
<p>The <code>combine_SI</code> argument of the functions that return results per category, <code>antibiogram()</code>, and <code>wisca()</code> is deprecated in favour of <code>guideline</code>. If set, it is followed literally and takes precedence over <code>guideline</code>.</p>
</div>
<div class="section level2">
<h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a></h2>
<ul><li><p>Hebert C <em>et al.</em> (2012). <strong>Demonstration of the weighted-incidence syndromic combination antibiogram: an empiric prescribing decision aid.</strong> <em>Infection Control &amp; Hospital Epidemiology</em> 33(4):381-388; <a href="https://doi.org/10.1086/664768" class="external-link">doi:10.1086/664768</a></p></li>
<li><p>Bielicki JA <em>et al.</em> (2016). <strong>Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data.</strong> <em>Journal of Antimicrobial Chemotherapy</em> 71(3):794-802; <a href="https://doi.org/10.1093/jac/dkv397" class="external-link">doi:10.1093/jac/dkv397</a></p></li>
<li><p>Cook A <em>et al.</em> (2022). <strong>Improving empiric antibiotic prescribing in pediatric bloodstream infections: a potential application of weighted-incidence syndromic combination antibiograms (WISCA).</strong> <em>Expert Review of Anti-infective Therapy</em> 20(3):445-456; <a href="https://doi.org/10.1080/14787210.2021.1967145" class="external-link">doi:10.1080/14787210.2021.1967145</a></p></li>
<li><p>Klinker KP <em>et al.</em> (2021). <strong>Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms.</strong> <em>Therapeutic Advances in Infectious Disease</em>, May 5;8:20499361211011373; <a href="https://doi.org/10.1177/20499361211011373" class="external-link">doi:10.1177/20499361211011373</a></p></li>
<li><p>Barbieri E <em>et al.</em> (2021). <strong>Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach.</strong> <em>Antimicrobial Resistance &amp; Infection Control</em> May 1;10(1):74; <a href="https://doi.org/10.1186/s13756-021-00939-2" class="external-link">doi:10.1186/s13756-021-00939-2</a></p></li>
<li><p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition</strong>, 2022, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href="https://clsi.org/standards/products/microbiology/documents/m39/" class="external-link">https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p></li>
</ul></div>
<div class="section level2">
<h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
<p>Implementation: Dr. Larisse Bolton and Dr. Matthijs Berends</p>
</div>
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># example_isolates is a data set available in the AMR package.</span></span></span>
<span class="r-in"><span><span class="co"># run ?example_isolates for more info.</span></span></span>
<span class="r-in"><span><span class="va">example_isolates</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2,000 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 2002-01-02 A77334 65 F Clinical <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2002-01-03 A77334 65 F Clinical <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2002-01-07 067927 45 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2002-01-07 067927 45 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 2002-01-13 067927 45 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 2002-01-13 067927 45 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 2002-01-14 462729 78 M Clinical <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 2002-01-14 462729 78 M Clinical <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 2002-01-16 067927 45 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 2002-01-17 858515 79 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1,990 more rows</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 36 more variables: AMC &lt;sir&gt;, AMP &lt;sir&gt;, TZP &lt;sir&gt;, CZO &lt;sir&gt;, FEP &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># CXM &lt;sir&gt;, FOX &lt;sir&gt;, CTX &lt;sir&gt;, CAZ &lt;sir&gt;, CRO &lt;sir&gt;, GEN &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TOB &lt;sir&gt;, AMK &lt;sir&gt;, KAN &lt;sir&gt;, TMP &lt;sir&gt;, SXT &lt;sir&gt;, NIT &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># FOS &lt;sir&gt;, LNZ &lt;sir&gt;, CIP &lt;sir&gt;, MFX &lt;sir&gt;, VAN &lt;sir&gt;, TEC &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TCY &lt;sir&gt;, TGC &lt;sir&gt;, DOX &lt;sir&gt;, ERY &lt;sir&gt;, CLI &lt;sir&gt;, AZM &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># IPM &lt;sir&gt;, MEM &lt;sir&gt;, MTR &lt;sir&gt;, CHL &lt;sir&gt;, COL &lt;sir&gt;, MUP &lt;sir&gt;, …</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
<span class="r-in"><span><span class="co"># WISCA antibiogram (recommended for empirical therapy) -----------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># basic WISCA: empirical coverage per regimen, weighted by pathogen</span></span></span>
<span class="r-in"><span><span class="co"># incidence, with 95% credible intervals</span></span></span>
<span class="r-in"><span><span class="co"># (10 most common species, since rare species can distort coverage estimates)</span></span></span>
<span class="r-in"><span><span class="fu">wisca</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"AMC+GEN"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> `wisca()` assumes the EUCAST guideline and thus considers the 'I' category</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> susceptible, so S, SDD, and I count as covered. Use `guideline = "CLSI"` to</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> only count S and SDD as covered. Set the `guideline` argument, or set the</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> `AMR_guideline` option to change the default (see `?AMR-options`). This</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> message is shown once per session.</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Using column <span style="color: #00BB00; font-weight: bold;">mo</span> as input for `col_mo`.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 3</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 76.9% (74.7-79%) 89.5% (88-91.1%) 93.6% (92.4-94.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Amoxicillin/clavulanic acid + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and use `wisca_plot()` to assess the simulation outcomes.</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Or, use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># equivalent using antibiogram():</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"AMC+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> wisca <span class="op">=</span> <span class="cn">TRUE</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 3</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 76.8% (74.8-78.9%) 89.6% (88-91.1%) 93.7% (92.4-94.9%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Amoxicillin/clavulanic acid + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and use `wisca_plot()` to assess the simulation outcomes.</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Or, use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># stratified by syndrome or clinical group (5 most common species, for a readable plot)</span></span></span>
<span class="r-in"><span><span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">wisca</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">5</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 2 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 5.1%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-in"><span><span class="va">out</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 76.1% (69-83.5%) 99% (98.2-99.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 54% (45.3-66.7%) 98.4% (96.9-99.5%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 68.4% (47.5-89.2%) 96.1% (91-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` &lt;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and use `wisca_plot()` to assess the simulation outcomes.</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Or, use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"ggplot2"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="fu">wisca_plot</span><span class="op">(</span><span class="va">out</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-plt img"><img src="antibiogram-1.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># stratified using grouped tibbles (e.g. by age and gender)</span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"dplyr"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org" class="external-link">dplyr</a></span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span> <span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span>n <span class="op">=</span> <span class="fl">10</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span></span></span>
<span class="r-in"><span> age_group <span class="op">=</span> <span class="fu"><a href="age_groups.html">age_groups</a></span><span class="op">(</span><span class="va">age</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">25</span>, <span class="fl">50</span>, <span class="fl">75</span><span class="op">)</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> <span class="va">gender</span></span></span>
<span class="r-in"><span> <span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span> <span class="fu">wisca</span><span class="op">(</span>antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Number of tested isolates should exceed 30 for each regimen (and group). WISCA</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> coverage estimates might be inaccurate.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 12 of 24 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 33.3%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 8 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 0-24 F 74.7% (16.9-100%) 81.5% (54.9-97.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 83.5% (50.2-99.1%) 86.7% (66.6-98.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 92.1% (80.9-98.6%) 95.2% (88.9-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 80.5% (57.5-95.8%) 93.3% (85.3-98.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 75.6% (65.4-88%) 97% (94.7-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 68.1% (56.7-78.9%) 96.7% (94.1-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 75.1% (63.6-85.5%) 97.8% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 74.9% (64.4-84.2%) 97.8% (96.1-99.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` &lt;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and use `wisca_plot()` to assess the simulation outcomes.</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Or, use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Traditional antibiogram (for AMR surveillance) ------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antimicrobial_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `aminoglycosides()` using columns <span style="color: #00BB00; font-weight: bold;">GEN</span> (gentamicin), <span style="color: #00BB00; font-weight: bold;">TOB</span> (tobramycin), <span style="color: #00BB00; font-weight: bold;">AMK</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (amikacin), and <span style="color: #00BB00; font-weight: bold;">KAN</span> (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `carbapenems()` using columns <span style="color: #00BB00; font-weight: bold;">IPM</span> (imipenem) and <span style="color: #00BB00; font-weight: bold;">MEM</span> (meropenem)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> `antibiogram()` assumes the EUCAST guideline and thus considers the 'I'</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> category susceptible, so S, SDD, and I count as susceptible. Use `guideline =</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> "CLSI"` to only count S and SDD as susceptible. Set the `guideline` argument,</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> or set the `AMR_guideline` option to change the default (see `?AMR-options`).</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> This message is shown once per session.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 10 × 7</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Traditional Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Pathogen Amikacin Gentamicin Imipenem Kanamycin Meropenem Tobramycin</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> CoNS 0% (0-8%,N… 86% (82-9… 52% (37… 0% (0-8%… 52% (37-… 22% (12-3…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> E. coli 100% (98-1… 98% (96-9… 100% (9… <span style="color: #BB0000;">NA</span> 100% (99… 97% (96-9…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> E. faecalis 0% (0-9%,N… 0% (0-9%,… 100% (9… 0% (0-9%… <span style="color: #BB0000;">NA</span> 0% (0-9%,…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> K. pneumoniae <span style="color: #BB0000;">NA</span> 90% (79-9… 100% (9… <span style="color: #BB0000;">NA</span> 100% (93… 90% (79-9…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> P. aeruginosa <span style="color: #BB0000;">NA</span> 100% (88-… <span style="color: #BB0000;">NA</span> 0% (0-12… <span style="color: #BB0000;">NA</span> 100% (88-…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> P. mirabilis <span style="color: #BB0000;">NA</span> 94% (80-9… 94% (79… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> 94% (80-9…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> S. aureus <span style="color: #BB0000;">NA</span> 99% (97-1… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> 98% (92-1…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> S. epidermidis 0% (0-8%,N… 79% (71-8… <span style="color: #BB0000;">NA</span> 0% (0-8%… <span style="color: #BB0000;">NA</span> 51% (40-6…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> S. hominis <span style="color: #BB0000;">NA</span> 92% (84-9… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> 85% (74-9…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> S. pneumoniae 0% (0-3%,N… 0% (0-3%,… <span style="color: #BB0000;">NA</span> 0% (0-3%… <span style="color: #BB0000;">NA</span> 0% (0-3%,…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"atc"</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `aminoglycosides()` using columns <span style="color: #00BB00; font-weight: bold;">GEN</span> (gentamicin), <span style="color: #00BB00; font-weight: bold;">TOB</span> (tobramycin), <span style="color: #00BB00; font-weight: bold;">AMK</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (amikacin), and <span style="color: #00BB00; font-weight: bold;">KAN</span> (kanamycin)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Traditional Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Pathogen J01GB01 J01GB03 J01GB04 J01GB06 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-negative 96% (94-97%,N=686) 96% (95-98%,N=684) 0% (0-10%,N=35) 98% (96-…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-positive 34% (31-38%,N=665) 63% (60-66%,N=1170) 0% (0-1%,N=436) 0% (0-1%…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Combination antibiogram (for AMR surveillance) ------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Combination Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Pathogen Piperacillin/tazobac…¹ Piperacillin/tazobac…² Piperacillin/tazobac…³</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-neg… 88% (85-91%,N=641) 99% (97-99%,N=691) 98% (97-99%,N=693) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-pos… 86% (82-89%,N=345) 98% (96-98%,N=1044) 95% (93-97%,N=550) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Piperacillin/tazobactam`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Piperacillin/tazobactam + Gentamicin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ³​`Piperacillin/tazobactam + Tobramycin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># you can use any antimicrobial selector with `+` too:</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="antimicrobial_selectors.html">ureidopenicillins</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">""</span>, <span class="st">"GEN"</span>, <span class="st">"tobra"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `ureidopenicillins()` using column <span style="color: #00BB00; font-weight: bold;">TZP</span> (piperacillin/tazobactam)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Combination Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Pathogen Piperacillin/tazobac…¹ Piperacillin/tazobac…² Piperacillin/tazobac…³</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-neg… 88% (85-91%,N=641) 99% (97-99%,N=691) 98% (97-99%,N=693) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-pos… 86% (82-89%,N=345) 98% (96-98%,N=1044) 95% (93-97%,N=550) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Piperacillin/tazobactam`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Piperacillin/tazobactam + Gentamicin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ³​`Piperacillin/tazobactam + Tobramycin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># names of antimicrobials do not need to resemble columns exactly:</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Cipro"</span>, <span class="st">"cipro + genta"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> sep <span class="op">=</span> <span class="st">" &amp; "</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 3</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Traditional Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Pathogen Ciprofloxacin `Ciprofloxacin &amp; Gentamicin`</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Gram-negative 91% (88-93%,N=684) 99% (97-99%,N=694) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Gram-positive 77% (74-80%,N=724) 93% (91-94%,N=847) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Syndromic antibiogram (for AMR surveillance) --------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="antimicrobial_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `aminoglycosides()` using columns <span style="color: #00BB00; font-weight: bold;">GEN</span> (gentamicin), <span style="color: #00BB00; font-weight: bold;">TOB</span> (tobramycin), <span style="color: #00BB00; font-weight: bold;">AMK</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (amikacin), and <span style="color: #00BB00; font-weight: bold;">KAN</span> (kanamycin)</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `carbapenems()` using columns <span style="color: #00BB00; font-weight: bold;">IPM</span> (imipenem) and <span style="color: #00BB00; font-weight: bold;">MEM</span> (meropenem)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 14 × 8</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Syndromic Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Syndromic Group` Pathogen Amikacin Gentamicin Imipenem Kanamycin Meropenem</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical CoNS <span style="color: #BB0000;">NA</span> 89% (84-9… 57% (39… <span style="color: #BB0000;">NA</span> 57% (39-…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU CoNS <span style="color: #BB0000;">NA</span> 79% (68-8… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Outpatient CoNS <span style="color: #BB0000;">NA</span> 84% (66-9… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical E. coli 100% (9… 98% (96-9… 100% (9… <span style="color: #BB0000;">NA</span> 100% (99…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU E. coli 100% (9… 99% (95-1… 100% (9… <span style="color: #BB0000;">NA</span> 100% (97…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical K. pneumo… <span style="color: #BB0000;">NA</span> 92% (81-9… 100% (9… <span style="color: #BB0000;">NA</span> 100% (92…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical P. mirabi… <span style="color: #BB0000;">NA</span> 100% (88-… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical S. aureus <span style="color: #BB0000;">NA</span> 99% (95-1… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU S. aureus <span style="color: #BB0000;">NA</span> 100% (95-… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical S. epider… <span style="color: #BB0000;">NA</span> 82% (72-9… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">11</span> ICU S. epider… <span style="color: #BB0000;">NA</span> 72% (60-8… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">12</span> Clinical S. hominis <span style="color: #BB0000;">NA</span> 96% (85-9… <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">13</span> Clinical S. pneumo… 0% (0-5… 0% (0-5%,… <span style="color: #BB0000;">NA</span> 0% (0-5%… <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">14</span> ICU S. pneumo… 0% (0-1… 0% (0-12%… <span style="color: #BB0000;">NA</span> 0% (0-12… <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1 more variable: Tobramycin &lt;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># with a custom language, though this will be determined automatically</span></span></span>
<span class="r-in"><span><span class="co"># (i.e., this table will be in Spanish on Spanish systems)</span></span></span>
<span class="r-in"><span><span class="va">ex1</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu"><a href="mo_property.html">mo_genus</a></span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="st">"Escherichia"</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Using column <span style="color: #00BB00; font-weight: bold;">mo</span> as input for `mo_genus()`</span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">ex1</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> ab_transform <span class="op">=</span> <span class="st">"name"</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(</span><span class="va">ex1</span><span class="op">$</span><span class="va">ward</span> <span class="op">==</span> <span class="st">"ICU"</span>,</span></span>
<span class="r-in"><span> <span class="st">"UCI"</span>, <span class="st">"No UCI"</span></span></span>
<span class="r-in"><span> <span class="op">)</span>,</span></span>
<span class="r-in"><span> language <span class="op">=</span> <span class="st">"es"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `aminoglycosides()` using columns <span style="color: #00BB00; font-weight: bold;">GEN</span> (gentamicin), <span style="color: #00BB00; font-weight: bold;">TOB</span> (tobramycin), <span style="color: #00BB00; font-weight: bold;">AMK</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> (amikacin), and <span style="color: #00BB00; font-weight: bold;">KAN</span> (kanamycin)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Syndromic Antibiogram</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Conf. interval: 95%</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Grupo sindrómico` Patógeno Amikacina Gentamicina Tobramicina</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> No UCI E. coli 100% (97-100%,N=119) 98% (96-99%,N=32… 98% (96-99…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> UCI E. coli 100% (93-100%,N=52) 99% (95-100%,N=1… 96% (92-99…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># or use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Print the output for R Markdown / Quarto -----------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">ureido</span> <span class="op">&lt;-</span> <span class="fu">wisca</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="antimicrobial_selectors.html">ureidopenicillins</a></span><span class="op">(</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `ureidopenicillins()` using column <span style="color: #00BB00; font-weight: bold;">TZP</span> (piperacillin/tazobactam)</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 1 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 5.6%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># in an Rmd file, you would just need to return `ureido` in a chunk,</span></span></span>
<span class="r-in"><span><span class="co"># but to be explicit here:</span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"knitr"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/cat.html" class="external-link">cat</a></span><span class="op">(</span><span class="fu">knitr</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/knitr/man/knit_print.html" class="external-link">knit_print</a></span><span class="op">(</span><span class="va">ureido</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Syndromic Group |Piperacillin/tazobactam |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |:---------------|:-----------------------|</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |79.1% (72.2-85.8%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.3% (48.9-69%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |67.8% (49.1-87.9%) |</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Generate plots with ggplot2 or base R --------------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">ab1</span> <span class="op">&lt;-</span> <span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">ab2</span> <span class="op">&lt;-</span> <span class="fu">wisca</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 4 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 6.4%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"ggplot2"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span><span class="va">ab1</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-plt img"><img src="antibiogram-2.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"ggplot2"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span><span class="va">ab2</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-plt img"><img src="antibiogram-3.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="plot.html">plot</a></span><span class="op">(</span><span class="va">ab1</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="antibiogram-4.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="fu"><a href="plot.html">plot</a></span><span class="op">(</span><span class="va">ab2</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="antibiogram-5.png" alt="" width="700" height="433"></span>
<span class="r-plt img"><img src="antibiogram-6.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
</nav></aside></div>
<footer><div class="pkgdown-footer-left">
<p><code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE" class="external-link">GNU GPL 2.0</a>. Developed at the <a target="_blank" href="https://www.rug.nl" class="external-link">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl" class="external-link">University Medical Center Groningen</a> in the Netherlands, in collaboration with <a href="https://amr-for-r.org/authors.html">many colleagues from around the world</a>.</p>
</div>
<div class="pkgdown-footer-right">
<p><a target="_blank" href="https://www.rug.nl" class="external-link"><img src="https://amr-for-r.org/logo_rug.svg" style="max-width: 150px;"></a><a target="_blank" href="https://www.umcg.nl" class="external-link"><img src="https://amr-for-r.org/logo_umcg.svg" style="max-width: 150px;"></a></p>
</div>
</footer></div>
</body></html>