Built site for AMR@3.1.0.9011: 944078c

This commit is contained in:
github-actions committed 2026-10-30 11:54:22 +00:00
1 parent 578406c4c9
commit 268d60edec
121 files changed
+527 -518

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@
<a class="navbar-brand me-2" href="https://amr-for-r.org/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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+29 -28
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
@@ -698,6 +698,7 @@ pathogen incidence, with a 95% credible interval from Bayesian Monte
Carlo simulation:</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">wisca_result</span> <span class="op">&lt;-</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="fu"><a href="../reference/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="fu"><a href="../reference/antibiogram.html">wisca</a></span><span class="op">(</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">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span>
<span> minimum <span class="op">=</span> <span class="fl">10</span></span>
@@ -715,9 +716,9 @@ Carlo simulation:</p>
<th align="left">Piperacillin/tazobactam + Tobramycin</th>
</tr></thead>
<tbody><tr class="odd">
<td align="left">72.7% (67.5-77.4%)</td>
<td align="left">96% (95-97%)</td>
<td align="left">92.3% (89.7-94.6%)</td>
<td align="left">73% (67.1-79.3%)</td>
<td align="left">98.7% (98.1-99.2%)</td>
<td align="left">93.9% (90.4-96.7%)</td>
</tr></tbody>
</table>
<p>The output tells you: <em>“given the species distribution in your
@@ -758,58 +759,58 @@ accepts any column or expression:</p>
<tr class="odd">
<td align="left">0-24</td>
<td align="left">F</td>
<td align="left">75.5% (13.9-100%)</td>
<td align="left">81.5% (55.4-98.2%)</td>
<td align="left">84.4% (51.1-99.5%)</td>
<td align="left">76.2% (21-99.9%)</td>
<td align="left">81.2% (53.3-97.5%)</td>
<td align="left">83.5% (52-99.5%)</td>
</tr>
<tr class="even">
<td align="left">0-24</td>
<td align="left">M</td>
<td align="left">82.7% (44.7-99.5%)</td>
<td align="left">87.2% (68.3-98.2%)</td>
<td align="left">83.3% (48.4-99.5%)</td>
<td align="left">83.2% (49.6-99.5%)</td>
<td align="left">86.8% (66-98.1%)</td>
<td align="left">82.8% (48.8-99.4%)</td>
</tr>
<tr class="odd">
<td align="left">25-49</td>
<td align="left">F</td>
<td align="left">91.9% (79.5-98.7%)</td>
<td align="left">95.4% (88.9-98.9%)</td>
<td align="left">88.1% (69.4-98.2%)</td>
<td align="left">92.3% (82-98.6%)</td>
<td align="left">95.3% (89.3-98.9%)</td>
<td align="left">88.2% (70.8-97.9%)</td>
</tr>
<tr class="even">
<td align="left">25-49</td>
<td align="left">M</td>
<td align="left">81.1% (55.2-96.6%)</td>
<td align="left">93.3% (85.2-98.3%)</td>
<td align="left">85.1% (56.4-97.6%)</td>
<td align="left">81.1% (58.2-96%)</td>
<td align="left">93.4% (85.8-98%)</td>
<td align="left">84.9% (58.8-97.3%)</td>
</tr>
<tr class="odd">
<td align="left">50-74</td>
<td align="left">F</td>
<td align="left">75.4% (65.3-87.9%)</td>
<td align="left">97% (94.7-98.6%)</td>
<td align="left">90.1% (82.7-96.2%)</td>
<td align="left">75.5% (65.4-87.9%)</td>
<td align="left">96.9% (94.6-98.6%)</td>
<td align="left">90.2% (82.2-96.4%)</td>
</tr>
<tr class="even">
<td align="left">50-74</td>
<td align="left">M</td>
<td align="left">68% (55.9-78.6%)</td>
<td align="left">96.8% (93.9-98.7%)</td>
<td align="left">86.9% (77.1-94.7%)</td>
<td align="left">68.2% (57.2-79.2%)</td>
<td align="left">96.7% (94.1-98.7%)</td>
<td align="left">86.7% (77.3-95%)</td>
</tr>
<tr class="odd">
<td align="left">75+</td>
<td align="left">F</td>
<td align="left">75.1% (64.4-85.4%)</td>
<td align="left">97.7% (95.8-99%)</td>
<td align="left">92.6% (86.3-97%)</td>
<td align="left">75% (64.3-84.9%)</td>
<td align="left">97.7% (95.9-99%)</td>
<td align="left">92.6% (86.2-96.9%)</td>
</tr>
<tr class="even">
<td align="left">75+</td>
<td align="left">M</td>
<td align="left">74.9% (65.2-83.5%)</td>
<td align="left">97.8% (96.2-99%)</td>
<td align="left">94.4% (89.1-98%)</td>
<td align="left">74.7% (65.2-83.5%)</td>
<td align="left">97.8% (96.2-99.1%)</td>
<td align="left">94.5% (89.9-98%)</td>
</tr>
</tbody>
</table>
+10 -9
View File
@@ -643,6 +643,7 @@ Bayesian Monte Carlo simulation:
``` r
wisca_result <- example_isolates %>%
top_n_microorganisms(n = 10) %>%
wisca(
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
minimum = 10
@@ -652,7 +653,7 @@ wisca_result
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
| 72.7% (67.5-77.4%) | 96% (95-97%) | 92.3% (89.7-94.6%) |
| 73% (67.1-79.3%) | 98.7% (98.1-99.2%) | 93.9% (90.4-96.7%) |
The output tells you: *“given the species distribution in your data,
there is an estimated X% probability that this regimen covers the
@@ -679,14 +680,14 @@ wisca_out
| age_group | gender | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|:---|
| 0-24 | F | 75.5% (13.9-100%) | 81.5% (55.4-98.2%) | 84.4% (51.1-99.5%) |
| 0-24 | M | 82.7% (44.7-99.5%) | 87.2% (68.3-98.2%) | 83.3% (48.4-99.5%) |
| 25-49 | F | 91.9% (79.5-98.7%) | 95.4% (88.9-98.9%) | 88.1% (69.4-98.2%) |
| 25-49 | M | 81.1% (55.2-96.6%) | 93.3% (85.2-98.3%) | 85.1% (56.4-97.6%) |
| 50-74 | F | 75.4% (65.3-87.9%) | 97% (94.7-98.6%) | 90.1% (82.7-96.2%) |
| 50-74 | M | 68% (55.9-78.6%) | 96.8% (93.9-98.7%) | 86.9% (77.1-94.7%) |
| 75+ | F | 75.1% (64.4-85.4%) | 97.7% (95.8-99%) | 92.6% (86.3-97%) |
| 75+ | M | 74.9% (65.2-83.5%) | 97.8% (96.2-99%) | 94.4% (89.1-98%) |
| 0-24 | F | 76.2% (21-99.9%) | 81.2% (53.3-97.5%) | 83.5% (52-99.5%) |
| 0-24 | M | 83.2% (49.6-99.5%) | 86.8% (66-98.1%) | 82.8% (48.8-99.4%) |
| 25-49 | F | 92.3% (82-98.6%) | 95.3% (89.3-98.9%) | 88.2% (70.8-97.9%) |
| 25-49 | M | 81.1% (58.2-96%) | 93.4% (85.8-98%) | 84.9% (58.8-97.3%) |
| 50-74 | F | 75.5% (65.4-87.9%) | 96.9% (94.6-98.6%) | 90.2% (82.2-96.4%) |
| 50-74 | M | 68.2% (57.2-79.2%) | 96.7% (94.1-98.7%) | 86.7% (77.3-95%) |
| 75+ | F | 75% (64.3-84.9%) | 97.7% (95.9-99%) | 92.6% (86.2-96.9%) |
| 75+ | M | 74.7% (65.2-83.5%) | 97.8% (96.2-99.1%) | 94.5% (89.9-98%) |
Keep in mind that more granular stratification produces more relevant
estimates for each subgroup, but with wider credible intervals due to
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 73 KiB

+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+2 -2
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
@@ -193,7 +193,7 @@ function:</p>
<span><span class="co">#&gt; [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"</span></span>
<span><span class="co">#&gt; Importance of components:</span></span>
<span><span class="co">#&gt; PC1 PC2 PC3 PC4 PC5 PC6 PC7</span></span>
<span><span class="co">#&gt; Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 4.285e-17</span></span>
<span><span class="co">#&gt; Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 2.007e-16</span></span>
<span><span class="co">#&gt; Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00</span></span>
<span><span class="co">#&gt; Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00</span></span></code></pre></div>
<pre><code><span><span class="co">#&gt; Groups (n=4, named as 'order'):</span></span>
+1 -1
View File
@@ -117,7 +117,7 @@ summary(pca_result)
#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"
#> Importance of components:
#> PC1 PC2 PC3 PC4 PC5 PC6 PC7
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 4.285e-17
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 2.007e-16
#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00
#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00
```
+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -29,7 +29,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+21 -21
View File
@@ -32,7 +32,7 @@
<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.9010</small>
<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">
@@ -172,7 +172,7 @@
<p>The <code>AMR</code> package supports four types of antibiograms, with support for 28 languages. If used inside <a href="https://rmarkdown.rstudio.com" class="external-link">R Markdown</a> or <a href="https://quarto.org" class="external-link">Quarto</a>, the table will be printed in the right output format automatically (such as markdown, LaTeX, HTML, etc.).</p>
<p><strong>For empirical therapy guidance (i.e., coverage estimates), use WISCA</strong> (Weighted-Incidence Syndromic Combination Antibiogram). When a clinician starts empirical treatment, the causative pathogen is unknown. The relevant question is not <em>“what percentage of E. coli is susceptible?”</em> but <em>“what is the probability that this regimen will cover whatever pathogen is causing the infection?”</em>. WISCA answers that question directly, weighting susceptibility by pathogen incidence and providing credible intervals via Bayesian simulation. See <code><a href="articles/WISCA.html">vignette("WISCA")</a></code> for the full explanation.</p>
<div class="sourceCode" id="cb2"><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">example_isolates</span>,</span>
<code class="sourceCode R"><span><span class="fu"><a href="reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="fu"><a href="reference/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 class="co"># 10 most common species</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">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span>
<span> minimum <span class="op">=</span> <span class="fl">10</span><span class="op">)</span> <span class="co"># Recommended threshold: &gt;=30</span></span></code></pre></div>
<table class="table">
@@ -187,23 +187,23 @@
<th align="left">Piperacillin/tazobactam + Tobramycin</th>
</tr></thead>
<tbody><tr>
<td align="left">72.5% (67.7-77.1%)</td>
<td align="left">96% (95.1-96.9%)</td>
<td align="left">92.1% (89.3-94.4%)</td>
<td align="left">73% (67.7-79%)</td>
<td align="left">98.7% (98-99.2%)</td>
<td align="left">93.8% (90.5-96.6%)</td>
</tr></tbody>
</table>
<p>WISCA supports stratification by any clinical variable, so you can generate syndrome-specific or ward-specific coverage estimates:</p>
<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">example_isolates</span>,</span>
<code class="sourceCode R"><span><span class="fu"><a href="reference/antibiogram.html">wisca</a></span><span class="op">(</span><span class="fu"><a href="reference/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> 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> syndromic_group <span class="op">=</span> <span class="st">"ward"</span>,</span>
<span> minimum <span class="op">=</span> <span class="fl">10</span><span class="op">)</span> <span class="co"># Recommended threshold: &gt;=30</span></span>
<span><span class="co">#&gt; Warning: In 6 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than</span></span>
<span><span class="co">#&gt; 5% of the pathogen incidence (up to 13.3%), since many pathogens occur only rarely. Because WISCA</span></span>
<span><span class="co">#&gt; gives every pathogen a prior weight of 1 (Bielicki et al., 2016), such rare pathogens can strongly</span></span>
<span><span class="co">#&gt; lower the estimated coverage without reflecting the clinical expectation. Consider limiting the</span></span>
<span><span class="co">#&gt; analysis to the most common pathogens with `top_n_microorganisms()`, or grouping rare pathogens</span></span>
<span><span class="co">#&gt; before running WISCA.</span></span></code></pre></div>
<span><span class="co">#&gt; Warning: In 3 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than</span></span>
<span><span class="co">#&gt; 5% of the pathogen incidence (up to 6.4%), since there are few isolates relative to the number of</span></span>
<span><span class="co">#&gt; pathogens, i.e., rare pathogens or a small group. Because WISCA gives every pathogen a prior weight</span></span>
<span><span class="co">#&gt; of 1 (Bielicki et al., 2016), this can strongly lower the estimated coverage without reflecting the</span></span>
<span><span class="co">#&gt; clinical expectation. Consider limiting the analysis to the most common pathogens with</span></span>
<span><span class="co">#&gt; `top_n_microorganisms()`, or using fewer and larger groups.</span></span></code></pre></div>
<table class="table">
<colgroup>
<col width="14%">
@@ -220,21 +220,21 @@
<tbody>
<tr>
<td align="left">Clinical</td>
<td align="left">78% (72.7-83.4%)</td>
<td align="left">96.3% (95.1-97.3%)</td>
<td align="left">93% (89.4-95.7%)</td>
<td align="left">78.9% (72.8-85.6%)</td>
<td align="left">98.7% (97.8-99.3%)</td>
<td align="left">94.5% (90.3-97.6%)</td>
</tr>
<tr>
<td align="left">ICU</td>
<td align="left">59.7% (53.5-67.9%)</td>
<td align="left">92.2% (90-94.3%)</td>
<td align="left">88.2% (83.4-92.2%)</td>
<td align="left">57.3% (48.9-69.5%)</td>
<td align="left">97.5% (95.7-98.8%)</td>
<td align="left">91.7% (85.8-96.3%)</td>
</tr>
<tr>
<td align="left">Outpatient</td>
<td align="left">67.9% (51.9-84.7%)</td>
<td align="left">92.8% (88.2-96.6%)</td>
<td align="left">79.8% (64.9-92.9%)</td>
<td align="left">68% (49.4-88.5%)</td>
<td align="left">95.7% (90.7-98.7%)</td>
<td align="left">79.3% (62.7-93.8%)</td>
</tr>
</tbody>
</table>
+12 -12
View File
@@ -171,37 +171,37 @@ full explanation.
``` r
wisca(example_isolates,
wisca(top_n_microorganisms(example_isolates, n = 10), # 10 most common species
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
minimum = 10) # Recommended threshold: >=30
```
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
| 72.5% (67.7-77.1%) | 96% (95.1-96.9%) | 92.1% (89.3-94.4%) |
| 73% (67.7-79%) | 98.7% (98-99.2%) | 93.8% (90.5-96.6%) |
WISCA supports stratification by any clinical variable, so you can
generate syndrome-specific or ward-specific coverage estimates:
``` r
wisca(example_isolates,
wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward",
minimum = 10) # Recommended threshold: >=30
#> Warning: In 6 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than
#> 5% of the pathogen incidence (up to 13.3%), since many pathogens occur only rarely. Because WISCA
#> gives every pathogen a prior weight of 1 (Bielicki et al., 2016), such rare pathogens can strongly
#> lower the estimated coverage without reflecting the clinical expectation. Consider limiting the
#> analysis to the most common pathogens with `top_n_microorganisms()`, or grouping rare pathogens
#> before running WISCA.
#> Warning: In 3 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than
#> 5% of the pathogen incidence (up to 6.4%), since there are few isolates relative to the number of
#> pathogens, i.e., rare pathogens or a small group. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), this can strongly lower the estimated coverage without reflecting the
#> clinical expectation. Consider limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or using fewer and larger groups.
```
| Syndromic Group | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|
| Clinical | 78% (72.7-83.4%) | 96.3% (95.1-97.3%) | 93% (89.4-95.7%) |
| ICU | 59.7% (53.5-67.9%) | 92.2% (90-94.3%) | 88.2% (83.4-92.2%) |
| Outpatient | 67.9% (51.9-84.7%) | 92.8% (88.2-96.6%) | 79.8% (64.9-92.9%) |
| Clinical | 78.9% (72.8-85.6%) | 98.7% (97.8-99.3%) | 94.5% (90.3-97.6%) |
| ICU | 57.3% (48.9-69.5%) | 97.5% (95.7-98.8%) | 91.7% (85.8-96.3%) |
| Outpatient | 68% (49.4-88.5%) | 95.7% (90.7-98.7%) | 79.3% (62.7-93.8%) |
**For AMR surveillance**, traditional antibiograms remain the right tool
for tracking resistance per species over time:
+12 -12
View File
@@ -171,37 +171,37 @@ full explanation.
``` r
wisca(example_isolates,
wisca(top_n_microorganisms(example_isolates, n = 10), # 10 most common species
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
minimum = 10) # Recommended threshold: >=30
```
| Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|
| 72.5% (67.7-77.1%) | 96% (95.1-96.9%) | 92.1% (89.3-94.4%) |
| 73% (67.7-79%) | 98.7% (98-99.2%) | 93.8% (90.5-96.6%) |
WISCA supports stratification by any clinical variable, so you can
generate syndrome-specific or ward-specific coverage estimates:
``` r
wisca(example_isolates,
wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward",
minimum = 10) # Recommended threshold: >=30
#> Warning: In 6 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than
#> 5% of the pathogen incidence (up to 13.3%), since many pathogens occur only rarely. Because WISCA
#> gives every pathogen a prior weight of 1 (Bielicki et al., 2016), such rare pathogens can strongly
#> lower the estimated coverage without reflecting the clinical expectation. Consider limiting the
#> analysis to the most common pathogens with `top_n_microorganisms()`, or grouping rare pathogens
#> before running WISCA.
#> Warning: In 3 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen accounts for more than
#> 5% of the pathogen incidence (up to 6.4%), since there are few isolates relative to the number of
#> pathogens, i.e., rare pathogens or a small group. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), this can strongly lower the estimated coverage without reflecting the
#> clinical expectation. Consider limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or using fewer and larger groups.
```
| Syndromic Group | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin |
|:---|:---|:---|:---|
| Clinical | 78% (72.7-83.4%) | 96.3% (95.1-97.3%) | 93% (89.4-95.7%) |
| ICU | 59.7% (53.5-67.9%) | 92.2% (90-94.3%) | 88.2% (83.4-92.2%) |
| Outpatient | 67.9% (51.9-84.7%) | 92.8% (88.2-96.6%) | 79.8% (64.9-92.9%) |
| Clinical | 78.9% (72.8-85.6%) | 98.7% (97.8-99.3%) | 94.5% (90.3-97.6%) |
| ICU | 57.3% (48.9-69.5%) | 97.5% (95.7-98.8%) | 91.7% (85.8-96.3%) |
| Outpatient | 68% (49.4-88.5%) | 95.7% (90.7-98.7%) | 79.3% (62.7-93.8%) |
**For AMR surveillance**, traditional antibiograms remain the right tool
for tracking resistance per species over time:
+5 -5
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
@@ -49,22 +49,22 @@
</div>
<div class="section level2">
<h2 class="pkg-version" data-toc-text="3.1.0.9010" id="amr-3109010">AMR 3.1.0.9010<a class="anchor" aria-label="anchor" href="#amr-3109010"></a></h2>
<h2 class="pkg-version" data-toc-text="3.1.0.9011" id="amr-3109011">AMR 3.1.0.9011<a class="anchor" aria-label="anchor" href="#amr-3109011"></a></h2>
<p>This version fixes a critical bug in WISCA that biased all coverage estimates of <code><a href="../reference/antibiogram.html">wisca()</a></code> and <code>antibiogram(..., wisca = TRUE)</code> downwards since AMR 3.0.0. Users are strongly advised to re-run their WISCA analyses.</p>
<div class="section level4">
<h4 id="changed-3-1-0-9010">Changed<a class="anchor" aria-label="anchor" href="#changed-3-1-0-9010"></a></h4>
<h4 id="changed-3-1-0-9011">Changed<a class="anchor" aria-label="anchor" href="#changed-3-1-0-9011"></a></h4>
<ul><li>WISCA (<code><a href="../reference/antibiogram.html">wisca()</a></code> and <code>antibiogram(..., wisca = TRUE)</code>)
<ul><li>Fixed a critical bug that systematically underestimated the coverage of every WISCA since AMR 3.0.0. Pathogens absent from a syndromic group, and pathogens without any test result for a regimen, were still included in the model with only prior information: each added a prior weight of 1 to the pathogen incidence, and untested pathogens kept their full incidence weight while counting as about 50% susceptible. The bias was largest for stratified analyses (e.g., up to 14 percentage points for meropenem in random strata of <code>example_isolates</code>). Now, only pathogens that occur in a group and have at least one test result for the regimen are included. Please re-run all WISCA analyses (<a href="https://github.com/msberends/AMR/issues/337" class="external-link">#337</a>)</li>
<li>
<code><a href="../reference/antibiogram.html">retrieve_wisca_parameters()</a></code> now returns only the parameters actually used in the model, and <code>n_total</code> in the <code>long_numeric</code> attribute now counts only isolates of the pathogens included for that regimen</li>
<li>A new warning is given when the prior weight of 1 per pathogen (Bielicki <em>et al.</em>, 2016) accounts for more than 5% of the pathogen incidence, as many rare pathogens can then strongly lower the estimated coverage; consider <code><a href="../reference/top_n_microorganisms.html">top_n_microorganisms()</a></code> in that case</li>
<li>A new warning is given when the prior weight of 1 per pathogen (Bielicki <em>et al.</em>, 2016) accounts for more than 5% of the pathogen incidence, i.e., with rare pathogens or small groups, as this can strongly lower the estimated coverage; consider <code><a href="../reference/top_n_microorganisms.html">top_n_microorganisms()</a></code> or fewer and larger groups in that case</li>
</ul></li>
<li>Microorganism coercion (<code><a href="../reference/as.mo.html">as.mo()</a></code>)
<ul><li>Fixed the misaligned arrows in the message on taxonomically renamed microorganisms in colour-supporting consoles, for old names whose author reference lacks “<em>et al.</em>” (<a href="https://github.com/msberends/AMR/issues/336" class="external-link">#336</a>)</li>
</ul></li>
</ul></div>
<div class="section level4">
<h4 id="other-3-1-0-9010">Other<a class="anchor" aria-label="anchor" href="#other-3-1-0-9010"></a></h4>
<h4 id="other-3-1-0-9011">Other<a class="anchor" aria-label="anchor" href="#other-3-1-0-9011"></a></h4>
<ul><li>The manual index on the website was rewritten to improve findability, with sections ordered by task and a filter field</li>
<li>Fixed the link to the copyright section and added MycoBank as a taxonomy source in the <em>Welcome to AMR</em> vignette (<a href="https://github.com/msberends/AMR/issues/325" class="external-link">#325</a>)</li>
</ul></div>
+4 -4
View File
@@ -1,6 +1,6 @@
# Changelog
## AMR 3.1.0.9010
## AMR 3.1.0.9011
This version fixes a critical bug in WISCA that biased all coverage
estimates of [`wisca()`](https://amr-for-r.org/reference/antibiogram.md)
@@ -29,10 +29,10 @@ are strongly advised to re-run their WISCA analyses.
of the pathogens included for that regimen
- A new warning is given when the prior weight of 1 per pathogen
(Bielicki *et al.*, 2016) accounts for more than 5% of the pathogen
incidence, as many rare pathogens can then strongly lower the
estimated coverage; consider
incidence, i.e., with rare pathogens or small groups, as this can
strongly lower the estimated coverage; consider
[`top_n_microorganisms()`](https://amr-for-r.org/reference/top_n_microorganisms.md)
in that case
or fewer and larger groups in that case
- Microorganism coercion
([`as.mo()`](https://amr-for-r.org/reference/as.mo.md))
- Fixed the misaligned arrows in the message on taxonomically renamed
+1 -1
View File
@@ -10,7 +10,7 @@ articles:
PCA: PCA.html
WHONET: WHONET.html
WISCA: WISCA.html
last_built: 2026-10-30T11:41Z
last_built: 2026-10-30T11:49Z
urls:
reference: https://amr-for-r.org/reference
article: https://amr-for-r.org/articles
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ options(AMR_guideline = &quot;CLSI&quot;)"><meta property="og:image" content="ht
<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.9010</small>
<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">
+1 -1
View File
@@ -21,7 +21,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+54 -49
View File
@@ -13,7 +13,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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.9010</small>
<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">
@@ -378,7 +378,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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:</strong> Since every pathogen receives a prior weight of 1 in the Dirichlet distribution, pathogens found only once or a few times are given relatively much weight, which pulls the incidence towards a uniform distribution. Their very uncertain susceptibility 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 grouping rare pathogens before running WISCA.</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>
@@ -474,7 +474,8 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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="fu">wisca</span><span class="op">(</span><span class="va">example_isolates</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>
@@ -482,13 +483,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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> 74.9% (72.9-76.9%) 89.7% (88.3-91.1%) 91.9% (90.6-93.1%) </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>
@@ -496,7 +498,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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="va">example_isolates</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>
@@ -506,7 +508,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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> 74.9% (72.9-76.9%) 89.7% (88.1-91.1%) 91.9% (90.5-93%) </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>
@@ -518,14 +520,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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-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-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 many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</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>
@@ -533,9 +535,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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.4% (68.6-83.9%) 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.4% (45.4-67.2%) 98.4% (96.8-99.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 67% (47.6-88.5%) 96.2% (91.4-99%) </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>
@@ -560,26 +562,27 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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 many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</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 75.5% (14.7-100%) 81.6% (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.2% (45.8-99.5%) 86.6% (65.9-98.2%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 92% (80.3-98.7%) 95.3% (89.1-98.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 80.8% (57.8-96.3%) 93.3% (85-98.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 75.4% (66.2-86.5%) 97% (94.9-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 68.4% (58-78.4%) 96.8% (94.2-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 75% (63.9-84.4%) 97.8% (96.1-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 75% (65.1-83.6%) 97.9% (96-99.1%) </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>
@@ -751,18 +754,19 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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="va">example_isolates</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 2 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 13.3%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</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>
@@ -773,9 +777,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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 |77.8% (72.6-83.1%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |59.8% (53.9-67.7%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |68.4% (52.2-84.6%) |</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>
@@ -784,17 +788,18 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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="va">example_isolates</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 8 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 13.3%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</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>
+63 -57
View File
@@ -572,17 +572,18 @@ regimen do not contribute to its coverage, nor to its `n_total` in
`long_numeric`. Use `retrieve_wisca_parameters()` to get the parameters
that were used.
**Rare pathogens:** Since every pathogen receives a prior weight of 1 in
the Dirichlet distribution, pathogens found only once or a few times are
given relatively much weight, which pulls the incidence towards a
uniform distribution. Their very uncertain susceptibility 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
**Rare pathogens and small groups:** 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
[`top_n_microorganisms()`](https://amr-for-r.org/reference/top_n_microorganisms.md),
or grouping rare pathogens before running WISCA.
or using fewer and larger groups.
**Interpreting the output:** Overlapping credible intervals between
regimens indicate no significant difference in coverage; if a
@@ -819,7 +820,8 @@ example_isolates
# basic WISCA: empirical coverage per regimen, weighted by pathogen
# incidence, with 95% credible intervals
wisca(example_isolates,
# (10 most common species, since rare species can distort coverage estimates)
wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN")
)
#> ℹ `wisca()` assumes the EUCAST guideline and thus considers the 'I' category
@@ -827,13 +829,14 @@ wisca(example_isolates,
#> only count S and SDD as covered. Set the `guideline` argument, or set the
#> `AMR_guideline` option to change the default (see `?AMR-options`). This
#> message is shown once per session.
#> ℹ Using column mo as input for `col_mo`.
#> # A tibble: 1 × 3
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.9% (72.9-76.9%) 89.7% (88.3-91.1%) 91.9% (90.6-93.1%)
#> 1 76.9% (74.7-79%) 89.5% (88-91.1%) 93.6% (92.4-94.8%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -841,7 +844,7 @@ wisca(example_isolates,
#> # Or, use it directly in R Markdown or Quarto, see `antibiogram()`.
# equivalent using antibiogram():
antibiogram(example_isolates,
antibiogram(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN"),
wisca = TRUE
)
@@ -851,7 +854,7 @@ antibiogram(example_isolates,
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.9% (72.9-76.9%) 89.7% (88.1-91.1%) 91.9% (90.5-93%)
#> 1 76.8% (74.8-78.9%) 89.6% (88-91.1%) 93.7% (92.4-94.9%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -863,14 +866,14 @@ out <- wisca(top_n_microorganisms(example_isolates, n = 5),
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward"
)
#> ℹ Using column mo as input for `col_mo`.
#> Warning: In 2 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 5.1%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> accounts for more than 5% of the pathogen incidence (up to 5.1%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
out
#> # A tibble: 3 × 4
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -878,9 +881,9 @@ out
#> # Simulations: 1000 per stratum
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#> <chr> <chr> <chr>
#> 1 Clinical 76.4% (68.6-83.9%) 99% (98.2-99.6%)
#> 2 ICU 54.4% (45.4-67.2%) 98.4% (96.8-99.4%)
#> 3 Outpatient 67% (47.6-88.5%) 96.2% (91.4-99%)
#> 1 Clinical 76.1% (69-83.5%) 99% (98.2-99.6%)
#> 2 ICU 54% (45.3-66.7%) 98.4% (96.9-99.5%)
#> 3 Outpatient 68.4% (47.5-89.2%) 96.1% (91-99%)
#> # ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`
#> # ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -905,26 +908,27 @@ if (requireNamespace("dplyr")) {
#> Warning: Number of tested isolates should exceed 30 for each regimen (and group). WISCA
#> coverage estimates might be inaccurate.
#> Warning: In 12 of 24 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 33.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> accounts for more than 5% of the pathogen incidence (up to 33.3%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
#> # A tibble: 8 × 5
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹
#> <chr> <chr> <chr> <chr>
#> 1 0-24 F 75.5% (14.7-100%) 81.6% (54.9-97.3%)
#> 2 0-24 M 83.2% (45.8-99.5%) 86.6% (65.9-98.2%)
#> 3 25-49 F 92% (80.3-98.7%) 95.3% (89.1-98.8%)
#> 4 25-49 M 80.8% (57.8-96.3%) 93.3% (85-98.3%)
#> 5 50-74 F 75.4% (66.2-86.5%) 97% (94.9-98.7%)
#> 6 50-74 M 68.4% (58-78.4%) 96.8% (94.2-98.7%)
#> 7 75+ F 75% (63.9-84.4%) 97.8% (96.1-99%)
#> 8 75+ M 75% (65.1-83.6%) 97.9% (96-99.1%)
#> 1 0-24 F 74.7% (16.9-100%) 81.5% (54.9-97.3%)
#> 2 0-24 M 83.5% (50.2-99.1%) 86.7% (66.6-98.3%)
#> 3 25-49 F 92.1% (80.9-98.6%) 95.2% (88.9-98.7%)
#> 4 25-49 M 80.5% (57.5-95.8%) 93.3% (85.3-98.4%)
#> 5 50-74 F 75.6% (65.4-88%) 97% (94.7-98.6%)
#> 6 50-74 M 68.1% (56.7-78.9%) 96.7% (94.1-98.6%)
#> 7 75+ F 75.1% (63.6-85.5%) 97.8% (96-99%)
#> 8 75+ M 74.9% (64.4-84.2%) 97.8% (96.1-99.1%)
#> # ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`
#> # ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -1096,18 +1100,19 @@ antibiogram(ex1,
# Print the output for R Markdown / Quarto -----------------------------
ureido <- wisca(example_isolates,
ureido <- wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = ureidopenicillins(),
syndromic_group = "ward"
)
#> ℹ For `ureidopenicillins()` using column TZP (piperacillin/tazobactam)
#> Warning: In 2 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> Warning: In 1 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 5.6%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
# in an Rmd file, you would just need to return `ureido` in a chunk,
# but to be explicit here:
@@ -1118,9 +1123,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
#> |Clinical |77.8% (72.6-83.1%) |
#> |ICU |59.8% (53.9-67.7%) |
#> |Outpatient |68.4% (52.2-84.6%) |
#> |Clinical |79.1% (72.2-85.8%) |
#> |ICU |57.3% (48.9-69%) |
#> |Outpatient |67.8% (49.1-87.9%) |
# Generate plots with ggplot2 or base R --------------------------------
@@ -1129,17 +1134,18 @@ ab1 <- antibiogram(example_isolates,
antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"),
mo_transform = "gramstain"
)
ab2 <- wisca(example_isolates,
ab2 <- wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"),
syndromic_group = "ward"
)
#> Warning: In 8 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> Warning: In 4 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 6.4%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
if (requireNamespace("ggplot2")) {
ggplot2::autoplot(ab1)
+1 -1
View File
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %&amp;gt;%
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ The antibiotics data set has been renamed to antimicrobials. The old name will b
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+5 -5
View File
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
<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.9010</small>
<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">
@@ -469,10 +469,10 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 4 × 18</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> datetime index method ab_given mo_given host_given input_given</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&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> 2026-10-30 <span style="color: #949494;">11:42:12</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-10-30 <span style="color: #949494;">11:42:12</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-10-30 <span style="color: #949494;">11:42:12</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-10-30 <span style="color: #949494;">11:42:12</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2026-10-30 <span style="color: #949494;">11:50:46</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-10-30 <span style="color: #949494;">11:50:46</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-10-30 <span style="color: #949494;">11:50:46</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-10-30 <span style="color: #949494;">11:50:46</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 11 more variables: ab &lt;ab&gt;, mo &lt;mo&gt;, host &lt;chr&gt;, input &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># outcome &lt;sir&gt;, notes &lt;chr&gt;, guideline &lt;chr&gt;, ref_table &lt;chr&gt;, uti &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># breakpoint_S_R &lt;chr&gt;, site &lt;chr&gt;</span></span>
+4 -4
View File
@@ -790,10 +790,10 @@ sir_interpretation_history()
#> # A tibble: 4 × 18
#> datetime index method ab_given mo_given host_given input_given
#> <dttm> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 2026-10-30 11:42:12 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-30 11:42:12 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-30 11:42:12 1 DISK tobra Escherich… human 16
#> 4 2026-10-30 11:42:12 1 DISK genta Escherich… human 18
#> 1 2026-10-30 11:50:46 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-30 11:50:46 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-30 11:50:46 1 DISK tobra Escherich… human 16
#> 4 2026-10-30 11:50:46 1 DISK genta Escherich… human 18
#> # ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,
#> # outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
#> # breakpoint_S_R <chr>, site <chr>
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -21,7 +21,7 @@ Use as.sir() to transform MICs or disks measurements to SIR values."><meta prope
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+52 -51
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
@@ -154,27 +154,28 @@
<span class="r-in"><span><span class="va">df</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/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></span><span class="op">(</span><span class="fl">2000</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 47 42 29 42 34 46 24 12 12 45 22 36 43 12 8 15 36 39 24 16 32 32 46 13 35</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 5 18 39 23 40 11 13 40 49 41 47 12 15 19 27 7 5 47 2 23 21 6 48 16 27</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 48 37 9 31 44 36 4 2 7 27 47 30 10 28 20 19 9 26 47 25 23 25 48 33 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 9 17 2 46 24 47 27 43 38 26 41 6 9 25 43 1 5 3 48 14 5 21 17 28 48</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 10 47 27 19 35 45 20 18 28 1 20 34 11 31 9 44 6 5 27 42 2 19 33 39 7</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 18 21 35 7 45 12 4 16 29 32 23 30 37 25 38 22 41 30 27 22 47 33 10 14 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 44 40 17 42 35 5 6 13 8 38 45 37 1 43 45 10 46 38 19 43 10 21 44 37 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 5 33 3 10 43 36 31 27 3 43 13 15 23 32 26 41 13 16 37 16 18 24 26 24 27</span>
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] TRUE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE FALSE FALSE FALSE</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</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">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</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 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 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-11-14 058917 76 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS <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: #BCBCBC;">1</span> 2002-08-14 785317 51 F ICU <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-06-22 FD8039 75 F ICU <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: #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>
@@ -208,19 +209,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">condition</span>, <span class="va">date</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 style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [98]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [100]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient date condition new_episode</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;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 008218 2009-04-27 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 058917 2002-11-14 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 074321 2015-09-20 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 078381 2014-08-17 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 080086 2007-10-26 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 0D7D34 2011-03-16 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 0DBB93 2003-10-02 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 110918 2016-05-08 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 156730 2012-04-12 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 175532 2010-04-10 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 001213 2009-08-03 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 067927 2002-01-07 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 078381 2014-07-17 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 0DBF93 2015-12-03 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 105248 2005-06-16 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 110918 2016-05-08 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 130252 2002-04-08 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 16F0F7 2010-01-17 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 189795 2008-10-19 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 207752 2008-07-11 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
@@ -237,16 +238,16 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [95]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</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;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2009-04-27 008218 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2002-11-14 058917 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2015-09-20 074321 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2014-08-17 078381 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2007-10-26 080086 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2011-03-16 0D7D34 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2003-10-02 0DBB93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2016-05-08 110918 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2012-04-12 156730 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2010-04-10 175532 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2009-08-03 001213 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2002-01-07 067927 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2014-07-17 078381 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2015-12-03 0DBF93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2005-06-16 105248 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2016-05-08 110918 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2002-04-08 130252 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2010-01-17 16F0F7 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2008-10-19 189795 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2008-07-11 207752 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
@@ -262,9 +263,9 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</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;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 58 13 37 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 29 11 21 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 8 5 8 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 57 13 36 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 32 11 24 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 6 4 7 7</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
@@ -293,19 +294,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</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 style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [96]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [97]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</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;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 340066 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 904640 <span style="color: #949494;">B_</span>PROTS<span style="color: #949494;">_</span>MRBL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> E31724 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 074321 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMLY ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 660761 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>DYSG Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> D39422 <span style="color: #949494;">B_</span>KLBSL<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 408807 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 438596 <span style="color: #949494;">B_</span>HMPHL<span style="color: #949494;">_</span>INFL ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 964998 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> D08278 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> C82046 <span style="color: #949494;">B_</span>PANTO ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> C80762 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> A81782 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 534816 <span style="color: #949494;">F_</span>CANDD<span style="color: #949494;">_</span>ALBC Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> A3C336 <span style="color: #949494;">B_</span>KLBSL<span style="color: #949494;">_</span>OXYT Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> BF4515 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> CD4354 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> C25784 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 874171 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 067927 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
+51 -50
View File
@@ -178,27 +178,28 @@ x
df <- example_isolates[sample(seq_len(2000), size = 100), ]
get_episode(df$date, episode_days = 60) # indices
#> [1] 47 42 29 42 34 46 24 12 12 45 22 36 43 12 8 15 36 39 24 16 32 32 46 13 35
#> [26] 5 18 39 23 40 11 13 40 49 41 47 12 15 19 27 7 5 47 2 23 21 6 48 16 27
#> [51] 48 37 9 31 44 36 4 2 7 27 47 30 10 28 20 19 9 26 47 25 23 25 48 33 47
#> [76] 9 17 2 46 24 47 27 43 38 26 41 6 9 25 43 1 5 3 48 14 5 21 17 28 48
#> [1] 10 47 27 19 35 45 20 18 28 1 20 34 11 31 9 44 6 5 27 42 2 19 33 39 7
#> [26] 18 21 35 7 45 12 4 16 29 32 23 30 37 25 38 22 41 30 27 22 47 33 10 14 29
#> [51] 44 40 17 42 35 5 6 13 8 38 45 37 1 43 45 10 46 38 19 43 10 21 44 37 44
#> [76] 5 33 3 10 43 36 31 27 3 43 13 15 23 32 26 41 13 16 37 16 18 24 26 24 27
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
#> [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
#> [13] TRUE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE
#> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE
#> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE
#> [49] FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE
#> [61] FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE
#> [73] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE
#> [97] FALSE FALSE FALSE FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE
#> [25] TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE
#> [37] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> [49] TRUE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
#> [61] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
#> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE
#> [85] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> [97] TRUE FALSE FALSE FALSE
# filter on results from the third 60-day episode only, using base R
df[which(get_episode(df$date, 60) == 3), ]
#> # A tibble: 1 × 46
#> # A tibble: 2 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2002-11-14 058917 76 F ICU B_STPHY_HMNS R NA S NA
#> 1 2002-08-14 785317 51 F ICU B_ESCHR_COLI R NA NA NA
#> 2 2002-06-22 FD8039 75 F ICU B_ESCHR_COLI R NA NA NA
#> # ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,
#> # CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,
#> # TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
@@ -232,19 +233,19 @@ if (require("dplyr")) {
arrange(patient, condition, date)
}
#> # A tibble: 100 × 4
#> # Groups: patient, condition [98]
#> # Groups: patient, condition [100]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
#> 1 008218 2009-04-27 A TRUE
#> 2 058917 2002-11-14 B TRUE
#> 3 074321 2015-09-20 B TRUE
#> 4 078381 2014-08-17 A TRUE
#> 5 080086 2007-10-26 C TRUE
#> 6 0D7D34 2011-03-16 C TRUE
#> 7 0DBB93 2003-10-02 A TRUE
#> 8 110918 2016-05-08 A TRUE
#> 9 156730 2012-04-12 C TRUE
#> 10 175532 2010-04-10 C TRUE
#> 1 001213 2009-08-03 A TRUE
#> 2 067927 2002-01-07 C TRUE
#> 3 078381 2014-07-17 C TRUE
#> 4 0DBF93 2015-12-03 C TRUE
#> 5 105248 2005-06-16 C TRUE
#> 6 110918 2016-05-08 C TRUE
#> 7 130252 2002-04-08 A TRUE
#> 8 16F0F7 2010-01-17 C TRUE
#> 9 189795 2008-10-19 B TRUE
#> 10 207752 2008-07-11 B TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -261,16 +262,16 @@ if (require("dplyr")) {
#> # Groups: ward, patient [95]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 Clinical 2009-04-27 008218 1 TRUE
#> 2 ICU 2002-11-14 058917 1 TRUE
#> 3 ICU 2015-09-20 074321 1 TRUE
#> 4 ICU 2014-08-17 078381 1 TRUE
#> 5 Clinical 2007-10-26 080086 1 TRUE
#> 6 ICU 2011-03-16 0D7D34 1 TRUE
#> 7 ICU 2003-10-02 0DBB93 1 TRUE
#> 8 ICU 2016-05-08 110918 1 TRUE
#> 9 Clinical 2012-04-12 156730 1 TRUE
#> 10 ICU 2010-04-10 175532 1 TRUE
#> 1 Clinical 2009-08-03 001213 1 TRUE
#> 2 ICU 2002-01-07 067927 1 TRUE
#> 3 ICU 2014-07-17 078381 1 TRUE
#> 4 ICU 2015-12-03 0DBF93 1 TRUE
#> 5 Clinical 2005-06-16 105248 1 TRUE
#> 6 ICU 2016-05-08 110918 1 TRUE
#> 7 ICU 2002-04-08 130252 1 TRUE
#> 8 Clinical 2010-01-17 16F0F7 1 TRUE
#> 9 Clinical 2008-10-19 189795 1 TRUE
#> 10 ICU 2008-07-11 207752 1 TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -286,9 +287,9 @@ if (require("dplyr")) {
#> # A tibble: 3 × 5
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
#> <chr> <int> <int> <int> <int>
#> 1 Clinical 58 13 37 42
#> 2 ICU 29 11 21 26
#> 3 Outpatient 8 5 8 8
#> 1 Clinical 57 13 36 42
#> 2 ICU 32 11 24 29
#> 3 Outpatient 6 4 7 7
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -317,19 +318,19 @@ if (require("dplyr")) {
select(group_vars(.), flag_episode)
}
#> # A tibble: 100 × 4
#> # Groups: patient, mo, ward [96]
#> # Groups: patient, mo, ward [97]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 340066 B_ESCHR_COLI Clinical TRUE
#> 2 904640 B_PROTS_MRBL Clinical TRUE
#> 3 E31724 B_STPHY_CONS ICU TRUE
#> 4 074321 B_STPHY_HMLY ICU TRUE
#> 5 660761 B_STRPT_DYSG Clinical TRUE
#> 6 D39422 B_KLBSL_PNMN Clinical TRUE
#> 7 408807 B_STPHY_CONS Clinical TRUE
#> 8 438596 B_HMPHL_INFL ICU TRUE
#> 9 964998 B_STRPT_PNMN Clinical TRUE
#> 10 D08278 B_ESCHR_COLI ICU TRUE
#> 1 C82046 B_PANTO ICU TRUE
#> 2 C80762 B_ESCHR_COLI ICU TRUE
#> 3 A81782 B_STPHY_EPDR Clinical TRUE
#> 4 534816 F_CANDD_ALBC Clinical TRUE
#> 5 A3C336 B_KLBSL_OXYT Clinical TRUE
#> 6 BF4515 B_ESCHR_COLI ICU TRUE
#> 7 CD4354 B_ESCHR_COLI ICU TRUE
#> 8 C25784 B_STRPT_PNMN Outpatient TRUE
#> 9 874171 B_STRPT_PNMN Clinical TRUE
#> 10 067927 B_STPHY_EPDR ICU TRUE
#> # ℹ 90 more rows
# }
```
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+3 -3
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
@@ -91,9 +91,9 @@
<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="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.997912</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 3.016136</span>
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.03794453</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.07348485</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
+2 -2
View File
@@ -45,7 +45,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE)
``` r
kurtosis(rnorm(10000))
#> [1] 2.997912
#> [1] 3.016136
kurtosis(rnorm(10000), excess = TRUE)
#> [1] -0.03794453
#> [1] 0.07348485
```
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+44 -45
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
@@ -110,31 +110,30 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_sir</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">sir</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class <span style="color: #0000BB;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I I S I R I S S S R</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I R R I R I I R I I</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">sir</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.4743416 -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.4743416 -0.4743416 -0.4743416 1.8973666</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.7745967 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">mic</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">mic</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class <span style="color: #0000BB;">&lt;mic&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=0.0001 64 0.001 64 0.0002 &lt;=0.0001 0.008 0.064 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.0002 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0005 0.064 0.0005 0.064 0.0005 0.032 0.016 0.064 0.001 32 </span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">mic</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0884866 0.3131386 -0.8009600 0.4424330</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02072389 0.42148922 -0.78080678 2.21807699</span>
<span class="r-in"><span><span class="co"># equal to the Z-score of their log2:</span></span></span>
<span class="r-in"><span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span> <span class="op">-</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0884866 0.3131386 -0.8009600 0.4424330</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02072389 0.42148922 -0.78080678 2.21807699</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">disk</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_disk</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">disk</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class <span style="color: #0000BB;">&lt;disk&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 43 46 40 43 47 47 50 20 46 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 50 24 48 45 42 45 39 47 39 18</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">disk</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.1859655 0.5141399 -0.1422089 0.1859655 0.6235314 0.6235314</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.9517058 -2.3300383 0.5141399 -1.1267321</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.9732102 -1.4834370 0.7842374 0.5007781 0.2173188 0.5007781</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0661405 0.6897510 -0.0661405 -2.0503556</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">y</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
<span class="r-in"><span> id <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>,</span></span>
@@ -145,35 +144,35 @@
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">y</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A I 31 16 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 30 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 32 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 27 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 32 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 26 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 30 16 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I I 19 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 19 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 21 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 24 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 27 0.5 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 21 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 29 &lt;=0.25 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 20 &lt;=0.25 8</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"amox"</span>, <span style="color: #0000BB;">"cipr"</span>, <span style="color: #0000BB;">"gent"</span>, and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.87190417 -0.29007013 -0.44456433 -0.18707400 0.07298484 0.33047517</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02148677 1.33795527 -0.85654887 -0.85654887</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.42631712 -0.25690939 -0.68042872 0.09123205 -0.25690939 0.42072154</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.50542540 1.10767844 0.26063978 -0.76513259</span>
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op">&lt;-</span> <span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span>, <span class="fu"><a href="as.mic.html">is.mic</a></span><span class="op">(</span><span class="va">y</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> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"gent"</span> and <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-in"><span><span class="va">y</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></span><span class="op">(</span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 30 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 32 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 27 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 26 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I I 19 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 19 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 32 &lt;=8 4 0.4873980</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A I 31 16 4 1.6732521</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 30 16 4 1.6732521</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 21 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 24 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 20 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 27 0.5 8 0.7115125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 29 &lt;=0.25 16 0.7115125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 21 0.5 16 1.8973666</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="va">y</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
@@ -186,16 +185,16 @@
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"amox"</span>, <span style="color: #0000BB;">"cipr"</span>, <span style="color: #0000BB;">"gent"</span>, and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C S 27 &lt;=8 &lt;=2 -0.44456433 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 30 &lt;=8 &lt;=2 -0.29007013 0.1544942</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 D S 32 &lt;=8 &lt;=2 -0.18707400 0.2574903</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 I I 19 &lt;=8 &lt;=2 -0.85654887 0.4119845</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 J S 19 &lt;=8 &lt;=2 -0.85654887 0.4119845</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 G R 26 &lt;=8 &lt;=2 0.02148677 0.4660511</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 E R 27 &lt;=8 &lt;=2 0.07298484 0.5175492</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 F I 32 &lt;=8 4 0.33047517 0.7750395</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 A I 31 16 4 0.87190417 1.3164685</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 H R 30 16 4 1.33795527 1.7825196</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C S 21 &lt;=0.25 8 -0.68042872 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J S 20 &lt;=0.25 8 -0.76513259 0.08470387</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 A S 24 &lt;=0.25 8 -0.42631712 0.25411160</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 B I 26 &lt;=0.25 8 -0.25690939 0.42351933</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8 -0.25690939 0.42351933</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 D R 24 &lt;=0.25 8 0.09123205 0.77166077</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 I R 26 &lt;=0.25 8 0.26063978 0.94106850</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 F I 27 0.5 8 0.42072154 1.10115026</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 G S 21 0.5 16 0.50542540 1.18585412</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 H R 29 &lt;=0.25 16 1.10767844 1.78810716</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</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>
+43 -44
View File
@@ -85,31 +85,30 @@ suspicious.
sir <- random_sir(10)
sir
#> Class <sir>
#> [1] I I S I R I S S S R
#> [1] I R R I R I I R I I
mean_amr_distance(sir)
#> [1] -0.4743416 -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416
#> [7] -0.4743416 -0.4743416 -0.4743416 1.8973666
#> [1] -0.7745967 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967
#> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967
mic <- random_mic(10)
mic
#> Class <mic>
#> [1] <=0.0001 64 0.001 64 0.0002 <=0.0001 0.008 0.064
#> [9] 0.0002 0.125
#> [1] 0.0005 0.064 0.0005 0.064 0.0005 0.032 0.016 0.064 0.001 32
mean_amr_distance(mic)
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
#> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656
#> [7] 0.02072389 0.42148922 -0.78080678 2.21807699
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
#> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656
#> [7] 0.02072389 0.42148922 -0.78080678 2.21807699
disk <- random_disk(10)
disk
#> Class <disk>
#> [1] 43 46 40 43 47 47 50 20 46 31
#> [1] 50 24 48 45 42 45 39 47 39 18
mean_amr_distance(disk)
#> [1] 0.1859655 0.5141399 -0.1422089 0.1859655 0.6235314 0.6235314
#> [7] 0.9517058 -2.3300383 0.5141399 -1.1267321
#> [1] 0.9732102 -1.4834370 0.7842374 0.5007781 0.2173188 0.5007781
#> [7] -0.0661405 0.6897510 -0.0661405 -2.0503556
y <- data.frame(
id = LETTERS[1:10],
@@ -120,35 +119,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
#> 1 A I 31 16 4
#> 2 B S 30 <=8 <=2
#> 3 C S 27 <=8 <=2
#> 4 D S 32 <=8 <=2
#> 5 E R 27 <=8 <=2
#> 6 F I 32 <=8 4
#> 7 G R 26 <=8 <=2
#> 8 H R 30 16 4
#> 9 I I 19 <=8 <=2
#> 10 J S 19 <=8 <=2
#> 1 A S 24 <=0.25 8
#> 2 B I 26 <=0.25 8
#> 3 C S 21 <=0.25 8
#> 4 D R 24 <=0.25 8
#> 5 E I 26 <=0.25 8
#> 6 F I 27 0.5 8
#> 7 G S 21 0.5 16
#> 8 H R 29 <=0.25 16
#> 9 I R 26 <=0.25 8
#> 10 J S 20 <=0.25 8
mean_amr_distance(y)
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> [1] 0.87190417 -0.29007013 -0.44456433 -0.18707400 0.07298484 0.33047517
#> [7] 0.02148677 1.33795527 -0.85654887 -0.85654887
#> [1] -0.42631712 -0.25690939 -0.68042872 0.09123205 -0.25690939 0.42072154
#> [7] 0.50542540 1.10767844 0.26063978 -0.76513259
y$amr_distance <- mean_amr_distance(y, is.mic(y))
#> ℹ Calculating mean AMR distance based on columns "gent" and "tobr"
y[order(y$amr_distance), ]
#> id amox cipr gent tobr amr_distance
#> 2 B S 30 <=8 <=2 -0.5477003
#> 3 C S 27 <=8 <=2 -0.5477003
#> 4 D S 32 <=8 <=2 -0.5477003
#> 5 E R 27 <=8 <=2 -0.5477003
#> 7 G R 26 <=8 <=2 -0.5477003
#> 9 I I 19 <=8 <=2 -0.5477003
#> 10 J S 19 <=8 <=2 -0.5477003
#> 6 F I 32 <=8 4 0.4873980
#> 1 A I 31 16 4 1.6732521
#> 8 H R 30 16 4 1.6732521
#> 1 A S 24 <=0.25 8 -0.4743416
#> 2 B I 26 <=0.25 8 -0.4743416
#> 3 C S 21 <=0.25 8 -0.4743416
#> 4 D R 24 <=0.25 8 -0.4743416
#> 5 E I 26 <=0.25 8 -0.4743416
#> 9 I R 26 <=0.25 8 -0.4743416
#> 10 J S 20 <=0.25 8 -0.4743416
#> 6 F I 27 0.5 8 0.7115125
#> 8 H R 29 <=0.25 16 0.7115125
#> 7 G S 21 0.5 16 1.8973666
if (require("dplyr")) {
y %>%
@@ -161,16 +160,16 @@ if (require("dplyr")) {
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C S 27 <=8 <=2 -0.44456433 0.0000000
#> 2 B S 30 <=8 <=2 -0.29007013 0.1544942
#> 3 D S 32 <=8 <=2 -0.18707400 0.2574903
#> 4 I I 19 <=8 <=2 -0.85654887 0.4119845
#> 5 J S 19 <=8 <=2 -0.85654887 0.4119845
#> 6 G R 26 <=8 <=2 0.02148677 0.4660511
#> 7 E R 27 <=8 <=2 0.07298484 0.5175492
#> 8 F I 32 <=8 4 0.33047517 0.7750395
#> 9 A I 31 16 4 0.87190417 1.3164685
#> 10 H R 30 16 4 1.33795527 1.7825196
#> 1 C S 21 <=0.25 8 -0.68042872 0.00000000
#> 2 J S 20 <=0.25 8 -0.76513259 0.08470387
#> 3 A S 24 <=0.25 8 -0.42631712 0.25411160
#> 4 B I 26 <=0.25 8 -0.25690939 0.42351933
#> 5 E I 26 <=0.25 8 -0.25690939 0.42351933
#> 6 D R 24 <=0.25 8 0.09123205 0.77166077
#> 7 I R 26 <=0.25 8 0.26063978 0.94106850
#> 8 F I 27 0.5 8 0.42072154 1.10115026
#> 9 G S 21 0.5 16 0.50542540 1.18585412
#> 10 H R 29 <=0.25 16 1.10767844 1.78810716
if (require("dplyr")) {
# support for groups
example_isolates %>%
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
+1 -1
View File
@@ -9,7 +9,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<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.9010</small>
<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">
+1 -1
View File
@@ -7,7 +7,7 @@
<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.9010</small>
<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">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff. Show more