Browse Source

(v0.8.0.9000) website update

new-mo-algorithm
parent
commit
1b8e2366f7
  1. 4
      DESCRIPTION
  2. 9
      NEWS.md
  3. 2
      docs/404.html
  4. 2
      docs/LICENSE-text.html
  5. 403
      docs/articles/AMR.html
  6. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  7. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  8. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  9. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  10. 2
      docs/articles/EUCAST.html
  11. 58
      docs/articles/MDR.html
  12. 2
      docs/articles/SPSS.html
  13. 2
      docs/articles/WHONET.html
  14. 115
      docs/articles/benchmarks.html
  15. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png
  16. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png
  17. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png
  18. 2
      docs/articles/index.html
  19. 2
      docs/articles/resistance_predict.html
  20. 2
      docs/authors.html
  21. 4
      docs/index.html
  22. 56
      docs/news/index.html
  23. 2
      docs/reference/index.html
  24. 2
      index.md

4
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 0.8.0
Date: 2019-10-15
Version: 0.8.0.9000
Date: 2019-10-16
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

9
NEWS.md

@ -1,5 +1,12 @@ @@ -1,5 +1,12 @@
# AMR 0.8.0
# AMR 0.8.0.9000
<small>Last updated: 16-Oct-2019</small>
### New
### Changes
# AMR 0.8.0
### Breaking
* Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`:

2
docs/404.html

@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9107</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
</span>
</div>

2
docs/LICENSE-text.html

@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9107</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
</span>
</div>

403
docs/articles/AMR.html

@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
<h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">13 October 2019</h4>
<h4 class="date">16 October 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -196,7 +196,7 @@ @@ -196,7 +196,7 @@
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 13 October 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 16 October 2019.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -212,21 +212,21 @@ @@ -212,21 +212,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2019-10-13</td>
<td align="center">2019-10-16</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="center">2019-10-13</td>
<td align="center">2019-10-16</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
</tr>
<tr class="odd">
<td align="center">2019-10-13</td>
<td align="center">2019-10-16</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -321,42 +321,42 @@ @@ -321,42 +321,42 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2011-07-28</td>
<td align="center">N6</td>
<td align="center">Hospital C</td>
<td align="center">2012-05-14</td>
<td align="center">G6</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2012-08-16</td>
<td align="center">Q6</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">2012-03-26</td>
<td align="center">F8</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2017-05-07</td>
<td align="center">G5</td>
<td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">2010-04-06</td>
<td align="center">F7</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2015-10-29</td>
<td align="center">V10</td>
<td align="center">Hospital D</td>
<td align="center">2016-05-08</td>
<td align="center">O1</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
@ -365,26 +365,26 @@ @@ -365,26 +365,26 @@
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2013-08-21</td>
<td align="center">U1</td>
<td align="center">2017-05-22</td>
<td align="center">T6</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2017-06-24</td>
<td align="center">K6</td>
<td align="center">Hospital A</td>
<td align="center">2012-06-06</td>
<td align="center">X7</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
</tr>
</tbody>
</table>
@ -407,8 +407,8 @@ @@ -407,8 +407,8 @@
#
# Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- -------------
# 1 M 10,399 52.00% 10,399 52.00%
# 2 F 9,601 48.01% 20,000 100.00%</code></pre>
# 1 M 10,380 51.9% 10,380 51.9%
# 2 F 9,620 48.1% 20,000 100.0%</code></pre>
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -438,14 +438,14 @@ @@ -438,14 +438,14 @@
<a class="sourceLine" id="cb15-18" data-line-number="18"><span class="co"># Pasteurella multocida (no changes)</span></a>
<a class="sourceLine" id="cb15-19" data-line-number="19"><span class="co"># Staphylococcus (no changes)</span></a>
<a class="sourceLine" id="cb15-20" data-line-number="20"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,461 values changed)</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"><span class="co"># Streptococcus pneumoniae (1,483 values changed)</span></a>
<a class="sourceLine" id="cb15-22" data-line-number="22"><span class="co"># Viridans group streptococci (no changes)</span></a>
<a class="sourceLine" id="cb15-23" data-line-number="23"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-24" data-line-number="24"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,290 values changed)</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,268 values changed)</span></a>
<a class="sourceLine" id="cb15-26" data-line-number="26"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb15-27" data-line-number="27"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,724 values changed)</span></a>
<a class="sourceLine" id="cb15-28" data-line-number="28"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,755 values changed)</span></a>
<a class="sourceLine" id="cb15-29" data-line-number="29"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb15-30" data-line-number="30"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb15-31" data-line-number="31"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -453,24 +453,24 @@ @@ -453,24 +453,24 @@
<a class="sourceLine" id="cb15-33" data-line-number="33"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<a class="sourceLine" id="cb15-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-35" data-line-number="35"><span class="co"># Other rules</span></a>
<a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,293 values changed)</span></a>
<a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (126 values changed)</span></a>
<a class="sourceLine" id="cb15-36" data-line-number="36"><span class="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,282 values changed)</span></a>
<a class="sourceLine" id="cb15-37" data-line-number="37"><span class="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (122 values changed)</span></a>
<a class="sourceLine" id="cb15-38" data-line-number="38"><span class="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<a class="sourceLine" id="cb15-39" data-line-number="39"><span class="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb15-40" data-line-number="40"><span class="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
<a class="sourceLine" id="cb15-41" data-line-number="41"><span class="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<a class="sourceLine" id="cb15-42" data-line-number="42"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-43" data-line-number="43"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,534 out of 20,000 rows, making a total of 7,894 edits</span></a>
<a class="sourceLine" id="cb15-44" data-line-number="44"><span class="co"># EUCAST rules affected 6,530 out of 20,000 rows, making a total of 7,910 edits</span></a>
<a class="sourceLine" id="cb15-45" data-line-number="45"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb15-46" data-line-number="46"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,894 test results</span></a>
<a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># - 126 test results changed from S to I</span></a>
<a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># - 4,707 test results changed from S to R</span></a>
<a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># - 1,073 test results changed from I to S</span></a>
<a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># - 317 test results changed from I to R</span></a>
<a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># - 1,653 test results changed from R to S</span></a>
<a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># - 18 test results changed from R to I</span></a>
<a class="sourceLine" id="cb15-47" data-line-number="47"><span class="co"># =&gt; changed 7,910 test results</span></a>
<a class="sourceLine" id="cb15-48" data-line-number="48"><span class="co"># - 109 test results changed from S to I</span></a>
<a class="sourceLine" id="cb15-49" data-line-number="49"><span class="co"># - 4,678 test results changed from S to R</span></a>
<a class="sourceLine" id="cb15-50" data-line-number="50"><span class="co"># - 1,098 test results changed from I to S</span></a>
<a class="sourceLine" id="cb15-51" data-line-number="51"><span class="co"># - 322 test results changed from I to R</span></a>
<a class="sourceLine" id="cb15-52" data-line-number="52"><span class="co"># - 1,676 test results changed from R to S</span></a>
<a class="sourceLine" id="cb15-53" data-line-number="53"><span class="co"># - 27 test results changed from R to I</span></a>
<a class="sourceLine" id="cb15-54" data-line-number="54"><span class="co"># --------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb15-55" data-line-number="55"><span class="co"># </span></a>
<a class="sourceLine" id="cb15-56" data-line-number="56"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -498,8 +498,8 @@ @@ -498,8 +498,8 @@
<a class="sourceLine" id="cb17-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb17-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb17-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,663 first isolates (28.3% of total)</span></a></code></pre></div>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="co"># =&gt; Found 5,688 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -509,7 +509,7 @@ @@ -509,7 +509,7 @@
<div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient X9, sorted on date:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient I4, sorted on date:</p>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -525,8 +525,8 @@ @@ -525,8 +525,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-31</td>
<td align="center">X9</td>
<td align="center">2010-02-10</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -536,10 +536,10 @@ @@ -536,10 +536,10 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-04-03</td>
<td align="center">X9</td>
<td align="center">2010-02-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -547,8 +547,8 @@ @@ -547,8 +547,8 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-05-12</td>
<td align="center">X9</td>
<td align="center">2010-03-09</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -558,10 +558,10 @@ @@ -558,10 +558,10 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-08-29</td>
<td align="center">X9</td>
<td align="center">2010-04-06</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
@ -569,8 +569,8 @@ @@ -569,8 +569,8 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-07</td>
<td align="center">X9</td>
<td align="center">2010-07-14</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -580,30 +580,30 @@ @@ -580,30 +580,30 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-04-20</td>
<td align="center">X9</td>
<td align="center">2010-08-03</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-06-24</td>
<td align="center">X9</td>
<td align="center">2010-09-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-07-10</td>
<td align="center">X9</td>
<td align="center">2010-09-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -613,21 +613,21 @@ @@ -613,21 +613,21 @@
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-11-07</td>
<td align="center">X9</td>
<td align="center">2010-10-05</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-12-20</td>
<td align="center">X9</td>
<td align="center">2010-12-30</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -635,7 +635,7 @@ @@ -635,7 +635,7 @@
</tr>
</tbody>
</table>
<p>Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>If a column exists with a name like ‘key(…)ab’ the <code><a href="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">keyab =</span> <span class="kw"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(.)) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -646,7 +646,7 @@ @@ -646,7 +646,7 @@
<a class="sourceLine" id="cb20-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb20-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb20-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 15,141 first weighted isolates (75.7% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb20-10" data-line-number="10"><span class="co"># =&gt; Found 15,143 first weighted isolates (75.7% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -663,8 +663,8 @@ @@ -663,8 +663,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-31</td>
<td align="center">X9</td>
<td align="center">2010-02-10</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
@ -675,20 +675,20 @@ @@ -675,20 +675,20 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-04-03</td>
<td align="center">X9</td>
<td align="center">2010-02-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-05-12</td>
<td align="center">X9</td>
<td align="center">2010-03-09</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -699,10 +699,10 @@ @@ -699,10 +699,10 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-08-29</td>
<td align="center">X9</td>
<td align="center">2010-04-06</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
@ -711,8 +711,8 @@ @@ -711,8 +711,8 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2011-01-07</td>
<td align="center">X9</td>
<td align="center">2010-07-14</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
@ -723,71 +723,71 @@ @@ -723,71 +723,71 @@
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2011-04-20</td>
<td align="center">X9</td>
<td align="center">2010-08-03</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-06-24</td>
<td align="center">X9</td>
<td align="center">2010-09-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-07-10</td>
<td align="center">X9</td>
<td align="center">2010-09-19</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-11-07</td>
<td align="center">X9</td>
<td align="center">2010-10-05</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-12-20</td>
<td align="center">X9</td>
<td align="center">2010-12-30</td>
<td align="center">I4</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 8 isolates are flagged. In total, 75.7% of all isolates are marked ‘first weighted’ - 47.4% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 1, now 6 isolates are flagged. In total, 75.7% of all isolates are marked ‘first weighted’ - 47.3% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 15,141 isolates for analysis.</p>
<p>So we end up with 15,143 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb22-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
@ -795,6 +795,7 @@ @@ -795,6 +795,7 @@
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(data_1st)</a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th></th>
<th align="center">date</th>
<th align="center">patient_id</th>
<th align="center">hospital</th>
@ -811,93 +812,99 @@ @@ -811,93 +812,99 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2011-07-28</td>
<td align="center">N6</td>
<td align="center">Hospital C</td>
<td>1</td>
<td align="center">2012-05-14</td>
<td align="center">G6</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2012-08-16</td>
<td align="center">Q6</td>
<td align="center">Hospital C</td>
<td>3</td>
<td align="center">2010-04-06</td>
<td align="center">F7</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2017-05-07</td>
<td align="center">G5</td>
<td>5</td>
<td align="center">2017-05-22</td>
<td align="center">T6</td>
<td align="center">Hospital A</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">F</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2015-10-29</td>
<td align="center">V10</td>
<td>6</td>
<td align="center">2012-06-06</td>
<td align="center">X7</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2013-08-21</td>
<td align="center">U1</td>
<td>7</td>
<td align="center">2010-02-15</td>
<td align="center">O1</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2017-06-24</td>
<td align="center">K6</td>
<td align="center">Hospital A</td>
<td align="center">B_STPHY_AURS</td>
<td align="center">R</td>
<td>9</td>
<td align="center">2016-11-25</td>
<td align="center">C6</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
</tbody>
@ -919,7 +926,7 @@ @@ -919,7 +926,7 @@
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/clean/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: character<br>
Length: 15,141 (of which NA: 0 = 0%)<br>
Length: 15,143 (of which NA: 0 = 0%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -936,33 +943,33 @@ Longest: 24</p> @@ -936,33 +943,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,470</td>
<td align="right">49.34%</td>
<td align="right">7,470</td>
<td align="right">49.34%</td>
<td align="right">7,512</td>
<td align="right">49.61%</td>
<td align="right">7,512</td>
<td align="right">49.61%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,803</td>
<td align="right">25.12%</td>
<td align="right">11,273</td>
<td align="right">74.45%</td>
<td align="right">3,819</td>
<td align="right">25.22%</td>
<td align="right">11,331</td>
<td align="right">74.83%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,290</td>
<td align="right">15.12%</td>
<td align="right">13,563</td>
<td align="right">89.58%</td>
<td align="right">2,243</td>
<td align="right">14.81%</td>
<td align="right">13,574</td>
<td align="right">89.64%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,578</td>
<td align="right">10.42%</td>
<td align="right">15,141</td>
<td align="right">1,569</td>
<td align="right">10.36%</td>
<td align="right">15,143</td>
<td align="right">100.00%</td>
</tr>
</tbody>
@ -973,7 +980,7 @@ Longest: 24</p> @@ -973,7 +980,7 @@ Longest: 24</p>
<a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2>
<p>The functions <code><a href="../reference/portion.html">portion_S()</a></code>, <code><a href="../reference/portion.html">portion_SI()</a></code>, <code><a href="../reference/portion.html">portion_I()</a></code>, <code><a href="../reference/portion.html">portion_IR()</a></code> and <code><a href="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (<code><a href="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><a href="../reference/portion.html">portion_SI()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_R</a></span>(AMX)</a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4656231</span></a></code></pre></div>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="co"># [1] 0.4667503</span></a></code></pre></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -986,19 +993,19 @@ Longest: 24</p> @@ -986,19 +993,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4748959</td>
<td align="center">0.4672547</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4543224</td>
<td align="center">0.4670225</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4659041</td>
<td align="center">0.4648625</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4712529</td>
<td align="center">0.4669489</td>
</tr>
</tbody>
</table>
@ -1016,23 +1023,23 @@ Longest: 24</p> @@ -1016,23 +1023,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4748959</td>
<td align="center">4561</td>
<td align="center">0.4672547</td>
<td align="center">4535</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4543224</td>
<td align="center">5298</td>
<td align="center">0.4670225</td>
<td align="center">5246</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4659041</td>
<td align="center">2273</td>
<td align="center">0.4648625</td>
<td align="center">2291</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4712529</td>
<td align="center">3009</td>
<td align="center">0.4669489</td>
<td align="center">3071</td>
</tr>
</tbody>
</table>
@ -1052,27 +1059,27 @@ Longest: 24</p> @@ -1052,27 +1059,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.9285141</td>
<td align="center">0.8966533</td>
<td align="center">0.9929050</td>
<td align="center">0.9247870</td>
<td align="center">0.8880458</td>
<td align="center">0.9928115</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.8225602</td>
<td align="center">0.9017744</td>
<td align="center">0.9866920</td>
<td align="center">0.8132569</td>
<td align="center">0.8986616</td>
<td align="center">0.9859783</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.9250592</td>
<td align="center">0.9261110</td>
<td align="center">0.9968446</td>
<td align="center">0.9138518</td>
<td align="center">0.9185651</td>
<td align="center">0.9934538</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.6200873</td>
<td align="center">0.6290682</td>
<td align="center">0.0000000</td>
<td align="center">0.6200873</td>
<td align="center">0.6290682</td>
</tr>
</tbody>
</table>

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

2
docs/articles/EUCAST.html

@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
<h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">13 October 2019</h4>
<h4 class="date">16 October 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div>

58
docs/articles/MDR.html

@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
<h1>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">13 October 2019</h4>
<h4 class="date">16 October 2019</h4>
<div class="hidden name"><code>MDR.Rmd</code></div>
@ -230,18 +230,18 @@ @@ -230,18 +230,18 @@
<p>The data set looks like this now:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(my_TB_data)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># 1 R S S I S S</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="co"># 2 I R S R S R</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="co"># 3 S S R R R R</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co"># 4 S R R S S S</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="co"># 5 S R R S R R</span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># 6 R S S R R S</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># 1 S S R S R S</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="co"># 2 S R R S S R</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="co"># 3 R R S S R S</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co"># 4 R R R S S S</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="co"># 5 R R R R R R</span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># 6 R R R I S R</span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># kanamycin</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># 1 R</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># 2 R</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># 3 I</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># 1 I</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># 2 S</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># 3 R</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># 4 S</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># 5 S</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># 5 R</span></a>
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># 6 S</span></a></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1">my_TB_data<span class="op">$</span>mdr &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mdro.html">mdr_tb</a></span>(my_TB_data)</a>
@ -275,40 +275,40 @@ Unique: 5</p> @@ -275,40 +275,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3246</td>
<td align="right">64.92%</td>
<td align="right">3246</td>
<td align="right">64.92%</td>
<td align="right">3276</td>
<td align="right">65.52%</td>
<td align="right">3276</td>
<td align="right">65.52%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">681</td>
<td align="right">13.62%</td>
<td align="right">3927</td>
<td align="right">78.54%</td>
<td align="right">658</td>
<td align="right">13.16%</td>
<td align="right">3934</td>
<td align="right">78.68%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">593</td>
<td align="right">11.86%</td>
<td align="right">4520</td>
<td align="right">90.40%</td>
<td align="right">616</td>
<td align="right">12.32%</td>
<td align="right">4550</td>
<td align="right">91.00%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">276</td>