1
0
mirror of https://github.com/msberends/AMR.git synced 2025-05-02 03:03:51 +02:00
AMR/articles/WISCA.html
2025-05-01 12:53:35 +00:00

465 lines
35 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>Estimating Empirical Coverage with WISCA • 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.1/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.3.1/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="Estimating Empirical Coverage with WISCA">
<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="">2.1.1.9268</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="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="../articles/MDR.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-article">
<div class="row">
<main id="main" class="col-md-9"><div class="page-header">
<img src="../logo.svg" class="logo" alt=""><h1>Estimating Empirical Coverage with WISCA</h1>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/vignettes/WISCA.Rmd" class="external-link"><code>vignettes/WISCA.Rmd</code></a></small>
<div class="d-none name"><code>WISCA.Rmd</code></div>
</div>
<blockquote>
<p>This explainer was largely written by our <a href="https://chat.amr-for-r.org" class="external-link">AMR for R Assistant</a>, a ChatGPT
manually-trained model able to answer any question about the
<code>AMR</code> package.</p>
</blockquote>
<div class="section level2">
<h2 id="introduction">Introduction<a class="anchor" aria-label="anchor" href="#introduction"></a>
</h2>
<p>Clinical guidelines for empirical antimicrobial therapy require
<em>probabilistic reasoning</em>: what is the chance that a regimen will
cover the likely infecting organisms, before culture results are
available?</p>
<p>This is the purpose of <strong>WISCA</strong>, or
<strong>Weighted-Incidence Syndromic Combination
Antibiogram</strong>.</p>
<p>WISCA is a Bayesian approach that integrates:</p>
<ul>
<li>
<strong>Pathogen prevalence</strong> (how often each species causes
the syndrome),</li>
<li>
<strong>Regimen susceptibility</strong> (how often a regimen works
<em>if</em> the pathogen is known),</li>
</ul>
<p>to estimate the <strong>overall empirical coverage</strong> of
antimicrobial regimens, with quantified uncertainty.</p>
<p>This vignette explains how WISCA works, why it is useful, and how to
apply it using the <code>AMR</code> package.</p>
</div>
<div class="section level2">
<h2 id="why-traditional-antibiograms-fall-short">Why traditional antibiograms fall short<a class="anchor" aria-label="anchor" href="#why-traditional-antibiograms-fall-short"></a>
</h2>
<p>A standard antibiogram gives you:</p>
<pre><code>Species → Antibiotic → Susceptibility %</code></pre>
<p>But clinicians dont know the species <em>a priori</em>. They need to
choose a regimen that covers the <strong>likely pathogens</strong>,
without knowing which one is present.</p>
<p>Traditional antibiograms calculate the susceptibility % as just the
number of resistant isolates divided by the total number of tested
isolates. Therefore, traditional antibiograms:</p>
<ul>
<li>Fragment information by organism,</li>
<li>Do not weight by real-world prevalence,</li>
<li>Do not account for combination therapy or sample size,</li>
<li>Do not provide uncertainty.</li>
</ul>
</div>
<div class="section level2">
<h2 id="the-idea-of-wisca">The idea of WISCA<a class="anchor" aria-label="anchor" href="#the-idea-of-wisca"></a>
</h2>
<p>WISCA asks:</p>
<blockquote>
<p>“What is the <strong>probability</strong> that this regimen
<strong>will cover</strong> the pathogen, given the syndrome?”</p>
</blockquote>
<p>This means combining two things:</p>
<ul>
<li>
<strong>Incidence</strong> of each pathogen in the syndrome,</li>
<li>
<strong>Susceptibility</strong> of each pathogen to the
regimen.</li>
</ul>
<p>We can write this as:</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext mathvariant="normal">Coverage</mtext><mo>=</mo><munder><mo></mo><mi>i</mi></munder><mrow><mo stretchy="true" form="prefix">(</mo><msub><mtext mathvariant="normal">Incidence</mtext><mi>i</mi></msub><mo>×</mo><msub><mtext mathvariant="normal">Susceptibility</mtext><mi>i</mi></msub><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\text{Coverage} = \sum_i (\text{Incidence}_i \times \text{Susceptibility}_i)</annotation></semantics></math></p>
<p>For example, suppose:</p>
<ul>
<li>
<em>E. coli</em> causes 60% of cases, and 90% of <em>E. coli</em>
are susceptible to a drug.</li>
<li>
<em>Klebsiella</em> causes 40% of cases, and 70% of
<em>Klebsiella</em> are susceptible.</li>
</ul>
<p>Then:</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext mathvariant="normal">Coverage</mtext><mo>=</mo><mrow><mo stretchy="true" form="prefix">(</mo><mn>0.6</mn><mo>×</mo><mn>0.9</mn><mo stretchy="true" form="postfix">)</mo></mrow><mo>+</mo><mrow><mo stretchy="true" form="prefix">(</mo><mn>0.4</mn><mo>×</mo><mn>0.7</mn><mo stretchy="true" form="postfix">)</mo></mrow><mo>=</mo><mn>0.82</mn></mrow><annotation encoding="application/x-tex">\text{Coverage} = (0.6 \times 0.9) + (0.4 \times 0.7) = 0.82</annotation></semantics></math></p>
<p>But in real data, incidence and susceptibility are <strong>estimated
from samples</strong>, so they carry uncertainty. WISCA models this
<strong>probabilistically</strong>, using conjugate Bayesian
distributions.</p>
</div>
<div class="section level2">
<h2 id="the-bayesian-engine-behind-wisca">The Bayesian engine behind WISCA<a class="anchor" aria-label="anchor" href="#the-bayesian-engine-behind-wisca"></a>
</h2>
<div class="section level3">
<h3 id="pathogen-incidence">Pathogen incidence<a class="anchor" aria-label="anchor" href="#pathogen-incidence"></a>
</h3>
<p>Let:</p>
<ul>
<li>
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>K</mi><annotation encoding="application/x-tex">K</annotation></semantics></math>
be the number of pathogens,</li>
<li>
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mrow><mo stretchy="true" form="prefix">(</mo><mn>1</mn><mo>,</mo><mn>1</mn><mo>,</mo><mi></mi><mo>,</mo><mn>1</mn><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\alpha = (1, 1, \ldots, 1)</annotation></semantics></math>
be a <strong>Dirichlet</strong> prior (uniform),</li>
<li>
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mrow><mo stretchy="true" form="prefix">(</mo><msub><mi>n</mi><mn>1</mn></msub><mo>,</mo><mi></mi><mo>,</mo><msub><mi>n</mi><mi>K</mi></msub><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">n = (n_1, \ldots, n_K)</annotation></semantics></math>
be the observed counts per species.</li>
</ul>
<p>Then the posterior incidence is:</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mo></mo><mtext mathvariant="normal">Dirichlet</mtext><mrow><mo stretchy="true" form="prefix">(</mo><msub><mi>α</mi><mn>1</mn></msub><mo>+</mo><msub><mi>n</mi><mn>1</mn></msub><mo>,</mo><mi></mi><mo>,</mo><msub><mi>α</mi><mi>K</mi></msub><mo>+</mo><msub><mi>n</mi><mi>K</mi></msub><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">p \sim \text{Dirichlet}(\alpha_1 + n_1, \ldots, \alpha_K + n_K)</annotation></semantics></math></p>
<p>To simulate from this, we use:</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub><mo></mo><mtext mathvariant="normal">Gamma</mtext><mrow><mo stretchy="true" form="prefix">(</mo><msub><mi>α</mi><mi>i</mi></msub><mo>+</mo><msub><mi>n</mi><mi>i</mi></msub><mo>,</mo><mspace width="0.222em"></mspace><mn>1</mn><mo stretchy="true" form="postfix">)</mo></mrow><mo>,</mo><mspace width="1.0em"></mspace><msub><mi>p</mi><mi>i</mi></msub><mo>=</mo><mfrac><msub><mi>x</mi><mi>i</mi></msub><mrow><munderover><mo></mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>K</mi></munderover><msub><mi>x</mi><mi>j</mi></msub></mrow></mfrac></mrow><annotation encoding="application/x-tex">x_i \sim \text{Gamma}(\alpha_i + n_i,\ 1), \quad p_i = \frac{x_i}{\sum_{j=1}^{K} x_j}</annotation></semantics></math></p>
</div>
<div class="section level3">
<h3 id="susceptibility">Susceptibility<a class="anchor" aria-label="anchor" href="#susceptibility"></a>
</h3>
<p>Each pathogenregimen pair has a prior and data:</p>
<ul>
<li>Prior:
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext mathvariant="normal">Beta</mtext><mrow><mo stretchy="true" form="prefix">(</mo><msub><mi>α</mi><mn>0</mn></msub><mo>,</mo><msub><mi>β</mi><mn>0</mn></msub><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\text{Beta}(\alpha_0, \beta_0)</annotation></semantics></math>,
with default
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>α</mi><mn>0</mn></msub><mo>=</mo><msub><mi>β</mi><mn>0</mn></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\alpha_0 = \beta_0 = 1</annotation></semantics></math>
</li>
<li>Data:
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>S</mi><annotation encoding="application/x-tex">S</annotation></semantics></math>
susceptible out of
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>N</mi><annotation encoding="application/x-tex">N</annotation></semantics></math>
tested</li>
</ul>
<p>The
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>S</mi><annotation encoding="application/x-tex">S</annotation></semantics></math>
category could also include values SDD (susceptible, dose-dependent) and
I (intermediate [CLSI], or susceptible, increased exposure
[EUCAST]).</p>
<p>Then the posterior is:</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mo></mo><mtext mathvariant="normal">Beta</mtext><mrow><mo stretchy="true" form="prefix">(</mo><msub><mi>α</mi><mn>0</mn></msub><mo>+</mo><mi>S</mi><mo>,</mo><mspace width="0.222em"></mspace><msub><mi>β</mi><mn>0</mn></msub><mo>+</mo><mi>N</mi><mo></mo><mi>S</mi><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\theta \sim \text{Beta}(\alpha_0 + S,\ \beta_0 + N - S)</annotation></semantics></math></p>
</div>
<div class="section level3">
<h3 id="final-coverage-estimate">Final coverage estimate<a class="anchor" aria-label="anchor" href="#final-coverage-estimate"></a>
</h3>
<p>Putting it together:</p>
<ol style="list-style-type: decimal">
<li>Simulate pathogen incidence:
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>𝐩</mi><mo></mo><mtext mathvariant="normal">Dirichlet</mtext></mrow><annotation encoding="application/x-tex">\boldsymbol{p} \sim \text{Dirichlet}</annotation></semantics></math>
</li>
<li>Simulate susceptibility:
<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>θ</mi><mi>i</mi></msub><mo></mo><mtext mathvariant="normal">Beta</mtext><mrow><mo stretchy="true" form="prefix">(</mo><mn>1</mn><mo>+</mo><msub><mi>S</mi><mi>i</mi></msub><mo>,</mo><mspace width="0.222em"></mspace><mn>1</mn><mo>+</mo><msub><mi>R</mi><mi>i</mi></msub><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\theta_i \sim \text{Beta}(1 + S_i,\ 1 + R_i)</annotation></semantics></math>
</li>
<li>Combine:</li>
</ol>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext mathvariant="normal">Coverage</mtext><mo>=</mo><munderover><mo></mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>K</mi></munderover><msub><mi>p</mi><mi>i</mi></msub><mo></mo><msub><mi>θ</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\text{Coverage} = \sum_{i=1}^{K} p_i \cdot \theta_i</annotation></semantics></math></p>
<p>Repeat this simulation (e.g. 1000×) and summarise:</p>
<ul>
<li>
<strong>Mean</strong> = expected coverage</li>
<li>
<strong>Quantiles</strong> = credible interval</li>
</ul>
</div>
</div>
<div class="section level2">
<h2 id="practical-use-in-the-amr-package">Practical use in the <code>AMR</code> package<a class="anchor" aria-label="anchor" href="#practical-use-in-the-amr-package"></a>
</h2>
<div class="section level3">
<h3 id="prepare-data-and-simulate-synthetic-syndrome">Prepare data and simulate synthetic syndrome<a class="anchor" aria-label="anchor" href="#prepare-data-and-simulate-synthetic-syndrome"></a>
</h3>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><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://amr-for-r.org">AMR</a></span><span class="op">)</span></span>
<span><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span></span>
<span></span>
<span><span class="co"># Structure of our data</span></span>
<span><span class="va">data</span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># A tibble: 2,000 × 46</span></span></span>
<span><span class="co">#&gt; date patient age gender ward mo PEN OXA FLC AMX </span></span>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FFAFAF;"> R </span></span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FFAFAF;"> R </span></span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <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: #FFAFAF;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #B2B2B2;"> NA</span> </span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># 1,990 more rows</span></span></span>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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>
<span><span class="co">#&gt; <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>
<span></span>
<span><span class="co"># Add a fake syndrome column</span></span>
<span><span class="va">data</span><span class="op">$</span><span class="va">syndrome</span> <span class="op">&lt;-</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">data</span><span class="op">$</span><span class="va">mo</span> <span class="op"><a href="../reference/like.html">%like%</a></span> <span class="st">"coli"</span>, <span class="st">"UTI"</span>, <span class="st">"No UTI"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="basic-wisca-antibiogram">Basic WISCA antibiogram<a class="anchor" aria-label="anchor" href="#basic-wisca-antibiogram"></a>
</h3>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="va">data</span>,</span>
<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">"GEN"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="left">Amoxicillin/clavulanic acid</th>
<th align="left">Ciprofloxacin</th>
<th align="left">Gentamicin</th>
</tr></thead>
<tbody><tr class="odd">
<td align="left">73.7% (71.7-75.8%)</td>
<td align="left">77% (74.3-79.4%)</td>
<td align="left">72.8% (70.7-74.8%)</td>
</tr></tbody>
</table>
</div>
<div class="section level3">
<h3 id="use-combination-regimens">Use combination regimens<a class="anchor" aria-label="anchor" href="#use-combination-regimens"></a>
</h3>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="va">data</span>,</span>
<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 class="op">)</span></span></code></pre></div>
<table class="table">
<colgroup>
<col width="24%">
<col width="38%">
<col width="36%">
</colgroup>
<thead><tr class="header">
<th align="left">Amoxicillin/clavulanic acid</th>
<th align="left">Amoxicillin/clavulanic acid + Ciprofloxacin</th>
<th align="left">Amoxicillin/clavulanic acid + Gentamicin</th>
</tr></thead>
<tbody><tr class="odd">
<td align="left">73.8% (71.8-75.7%)</td>
<td align="left">87.5% (85.9-89%)</td>
<td align="left">89.7% (88.2-91.1%)</td>
</tr></tbody>
</table>
</div>
<div class="section level3">
<h3 id="stratify-by-syndrome">Stratify by syndrome<a class="anchor" aria-label="anchor" href="#stratify-by-syndrome"></a>
</h3>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="va">data</span>,</span>
<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> syndromic_group <span class="op">=</span> <span class="st">"syndrome"</span><span class="op">)</span></span></code></pre></div>
<table class="table">
<colgroup>
<col width="12%">
<col width="21%">
<col width="34%">
<col width="31%">
</colgroup>
<thead><tr class="header">
<th align="left">Syndromic Group</th>
<th align="left">Amoxicillin/clavulanic acid</th>
<th align="left">Amoxicillin/clavulanic acid + Ciprofloxacin</th>
<th align="left">Amoxicillin/clavulanic acid + Gentamicin</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">No UTI</td>
<td align="left">70.1% (67.8-72.3%)</td>
<td align="left">85.2% (83.1-87.2%)</td>
<td align="left">87.1% (85.3-88.7%)</td>
</tr>
<tr class="even">
<td align="left">UTI</td>
<td align="left">80.9% (77.7-83.8%)</td>
<td align="left">88.2% (85.7-90.5%)</td>
<td align="left">90.9% (88.7-93%)</td>
</tr>
</tbody>
</table>
<p>The <code>AMR</code> package is available in 20 languages, which can
all be used for the <code><a href="../reference/antibiogram.html">wisca()</a></code> function too:</p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="va">data</span>,</span>
<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> syndromic_group <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/grep.html" class="external-link">gsub</a></span><span class="op">(</span><span class="st">"UTI"</span>, <span class="st">"UCI"</span>, <span class="va">data</span><span class="op">$</span><span class="va">syndrome</span><span class="op">)</span>,</span>
<span> language <span class="op">=</span> <span class="st">"Spanish"</span><span class="op">)</span></span></code></pre></div>
<table class="table">
<colgroup>
<col width="12%">
<col width="21%">
<col width="34%">
<col width="31%">
</colgroup>
<thead><tr class="header">
<th align="left">Grupo sindrómico</th>
<th align="left">Amoxicilina/ácido clavulánico</th>
<th align="left">Amoxicilina/ácido clavulánico + Ciprofloxacina</th>
<th align="left">Amoxicilina/ácido clavulánico + Gentamicina</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">No UCI</td>
<td align="left">70% (67.8-72.4%)</td>
<td align="left">85.3% (83.3-87.2%)</td>
<td align="left">87% (85.3-88.8%)</td>
</tr>
<tr class="even">
<td align="left">UCI</td>
<td align="left">80.9% (77.7-83.9%)</td>
<td align="left">88.2% (85.5-90.6%)</td>
<td align="left">90.9% (88.7-93%)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section level2">
<h2 id="sensible-defaults-which-can-be-customised">Sensible defaults, which can be customised<a class="anchor" aria-label="anchor" href="#sensible-defaults-which-can-be-customised"></a>
</h2>
<ul>
<li>
<code>simulations = 1000</code>: number of Monte Carlo draws</li>
<li>
<code>conf_interval = 0.95</code>: coverage interval width</li>
<li>
<code>combine_SI = TRUE</code>: count “I” and “SDD” as
susceptible</li>
</ul>
</div>
<div class="section level2">
<h2 id="limitations">Limitations<a class="anchor" aria-label="anchor" href="#limitations"></a>
</h2>
<ul>
<li>It assumes your data are representative</li>
<li>No adjustment for patient-level covariates, although these could be
passed onto the <code>syndromic_group</code> argument</li>
<li>WISCA does not model resistance over time, you might want to use
<code>tidymodels</code> for that, for which we <a href="https://amr-for-r.org/articles/AMR_with_tidymodels.html">wrote a
basic introduction</a>
</li>
</ul>
</div>
<div class="section level2">
<h2 id="summary">Summary<a class="anchor" aria-label="anchor" href="#summary"></a>
</h2>
<p>WISCA enables:</p>
<ul>
<li>Empirical regimen comparison,</li>
<li>Syndrome-specific coverage estimation,</li>
<li>Fully probabilistic interpretation.</li>
</ul>
<p>It is available in the <code>AMR</code> package via either:</p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="../reference/antibiogram.html">antibiogram</a></span><span class="op">(</span><span class="va">...</span>, wisca <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="reference">Reference<a class="anchor" aria-label="anchor" href="#reference"></a>
</h2>
<p>Bielicki, JA, et al. (2016). <em>Selecting appropriate empirical
antibiotic regimens for paediatric bloodstream infections: application
of a Bayesian decision model to local and pooled antimicrobial
resistance surveillance data.</em> <strong>J Antimicrob
Chemother</strong>. 71(3):794-802. <a href="https://doi.org/10.1093/jac/dkv397" class="external-link uri">https://doi.org/10.1093/jac/dkv397</a></p>
</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 General Public License version 2.0 (GPL-2)</a>.<br>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.</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>