1
0
mirror of https://github.com/msberends/AMR.git synced 2025-09-11 05:29:40 +02:00

cli-147-2226

This commit is contained in:
github-actions
2024-05-20 17:04:05 +00:00
parent bb51c7b8b3
commit 704eb041fa
89 changed files with 329 additions and 269 deletions

View File

@@ -12,7 +12,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.1.1.9029</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.1.1.9031</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">
@@ -277,7 +277,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<div class="section level2">
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
<p><strong>Remember that you should filter your data to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href="first_isolate.html">first_isolate()</a></code> to determine them in your data set with one of the four available algorithms.</p>
<p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p>
<p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>. Since AMR v3.0, <code>proportion_SI()</code> and <code>proportion_I()</code> include dose-dependent susceptibility ('SDD').</p>
<p>Use <code>sir_confidence_interval()</code> to calculate the confidence interval, which relies on <code><a href="https://rdrr.io/r/stats/binom.test.html" class="external-link">binom.test()</a></code>, i.e., the Clopper-Pearson method. This function returns a vector of length 2 at default for antimicrobial <em>resistance</em>. Change the <code>side</code> argument to "left"/"min" or "right"/"max" to return a single value, and change the <code>ab_result</code> argument to e.g. <code>c("S", "I")</code> to test for antimicrobial <em>susceptibility</em>, see Examples.</p>
<p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><a href="count.html">count_*()</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code><a href="count.html">count_susceptible()</a></code><code>/</code><code><a href="count.html">count_all()</a></code>. <em>Low counts can influence the outcome - the <code>proportion_*()</code> functions may camouflage this, since they only return the proportion (albeit dependent on the <code>minimum</code> argument).</em></p>
<p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code><a href="as.sir.html">sir</a></code> class (created with <code><a href="as.sir.html">as.sir()</a></code>) and calculates the proportions S, I, and R. It also supports grouped variables. The function <code>sir_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p>
@@ -384,10 +384,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
<span class="r-in"><span><span class="fu">proportion_S</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">AMX</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.4022222</span>
<span class="r-in"><span><span class="fu">proportion_SI</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">AMX</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Note that proportion_SI() will also include dose-dependent</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> susceptibility, 'SDD'. This note will be shown once for this session.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.4044444</span>
<span class="r-in"><span><span class="fu">proportion_I</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">AMX</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Note that proportion_I() will also include dose-dependent susceptibility,</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> 'SDD'. This note will be shown once for this session.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.002222222</span>
<span class="r-in"><span><span class="fu">proportion_IR</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">AMX</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Note that proportion_IR() will also include dose-dependent</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> susceptibility, 'SDD'. This note will be shown once for this session.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5977778</span>
<span class="r-in"><span><span class="fu">proportion_R</span><span class="op">(</span><span class="va">example_isolates</span><span class="op">$</span><span class="va">AMX</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5955556</span>
@@ -511,21 +517,27 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">ward</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span> <span class="fu">sir_df</span><span class="op">(</span>translate <span class="op">=</span> <span class="cn">FALSE</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: 12 × 7</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward antibiotic interpretation value ci_min ci_max isolates</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">*</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;ord&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&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 AMX SI 0.423 0.389 0.457 357</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical AMX R 0.577 0.543 0.611 487</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical CIP SI 0.853 0.827 0.876 741</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical CIP R 0.147 0.124 0.173 128</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU AMX SI 0.369 0.323 0.417 158</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU AMX R 0.631 0.583 0.677 270</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU CIP SI 0.810 0.770 0.845 362</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU CIP R 0.190 0.155 0.230 85</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Outpatient AMX SI 0.397 0.288 0.515 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Outpatient AMX R 0.603 0.485 0.712 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">11</span> Outpatient CIP SI 0.839 0.748 0.907 78</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">12</span> Outpatient CIP R 0.161 0.093<span style="text-decoration: underline;">2</span> 0.252 15</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 18 × 7</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward antibiotic interpretation value ci_min ci_max isolates</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">*</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;ord&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&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 AMX SI 0.423 0.389 0.457 357</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical AMX R 0.577 0.543 0.611 487</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical AMX <span style="color: #BB0000;">NA</span> 0 0 0.004<span style="text-decoration: underline;">36</span> 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical CIP SI 0.853 0.827 0.876 741</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical CIP R 0.147 0.124 0.173 128</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical CIP <span style="color: #BB0000;">NA</span> 0 0 0.004<span style="text-decoration: underline;">24</span> 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU AMX SI 0.369 0.323 0.417 158</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU AMX R 0.631 0.583 0.677 270</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU AMX <span style="color: #BB0000;">NA</span> 0 0 0.008<span style="text-decoration: underline;">58</span> 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU CIP SI 0.810 0.770 0.845 362</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">11</span> ICU CIP R 0.190 0.155 0.230 85</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">12</span> ICU CIP <span style="color: #BB0000;">NA</span> 0 0 0.008<span style="text-decoration: underline;">22</span> 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">13</span> Outpatient AMX SI 0.397 0.288 0.515 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">14</span> Outpatient AMX R 0.603 0.485 0.712 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">15</span> Outpatient AMX <span style="color: #BB0000;">NA</span> 0 0 0.046<span style="text-decoration: underline;">2</span> 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">16</span> Outpatient CIP SI 0.839 0.748 0.907 78</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">17</span> Outpatient CIP R 0.161 0.093<span style="text-decoration: underline;">2</span> 0.252 15</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">18</span> Outpatient CIP <span style="color: #BB0000;">NA</span> 0 0 0.038<span style="text-decoration: underline;">9</span> 0</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>