mirror of
https://github.com/msberends/AMR.git
synced 2025-09-11 04:09:39 +02:00
Built site for AMR: 2.1.1.9013@f2d245b
This commit is contained in:
@@ -10,7 +10,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="">2.1.1.9012</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">2.1.1.9013</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">
|
||||
@@ -284,30 +284,30 @@ Ordered <a href="https://rdrr.io/r/base/factor.html" class="external-link">facto
|
||||
|
||||
<p>Custom guidelines can be set with the <code>custom_mdro_guideline()</code> function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.</p>
|
||||
<p>If you are familiar with the <code><a href="https://dplyr.tidyverse.org/reference/case_when.html" class="external-link">case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule is written <em>before</em> the tilde (<code>~</code>) and the consequence of the rule is written <em>after</em> the tilde:</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>custom <span class="ot"><-</span> <span class="fu">custom_mdro_guideline</span>(CIP <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">60</span> <span class="sc">~</span> <span class="st">"Elderly Type A"</span>,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> ERY <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">60</span> <span class="sc">~</span> <span class="st">"Elderly Type B"</span>)</span></code></pre><p></p></div>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>custom <span class="ot"><-</span> <span class="fu">custom_mdro_guideline</span>(CIP <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">60</span> <span class="sc">~</span> <span class="st">"Elderly Type A"</span>,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> ERY <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">60</span> <span class="sc">~</span> <span class="st">"Elderly Type B"</span>)</span></code></pre><p></p></div>
|
||||
<p>If a row/an isolate matches the first rule, the value after the first <code>~</code> (in this case <em>'Elderly Type A'</em>) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.</p>
|
||||
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>custom</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co">#> A set of custom MDRO rules:</span></span>
|
||||
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1. CIP is "R" and age is higher than 60 -> Elderly Type A</span></span>
|
||||
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 2. ERY is "R" and age is higher than 60 -> Elderly Type B</span></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3. Otherwise -> Negative</span></span>
|
||||
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co">#></span></span>
|
||||
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Unmatched rows will return NA.</span></span></code></pre><p></p></div>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>custom</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="co">#> A set of custom MDRO rules:</span></span>
|
||||
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="co">#> 1. CIP is "R" and age is higher than 60 -> Elderly Type A</span></span>
|
||||
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="co">#> 2. ERY is "R" and age is higher than 60 -> Elderly Type B</span></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a><span class="co">#> 3. Otherwise -> Negative</span></span>
|
||||
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a><span class="co">#></span></span>
|
||||
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a><span class="co">#> Unmatched rows will return NA.</span></span></code></pre><p></p></div>
|
||||
<p>The outcome of the function can be used for the <code>guideline</code> argument in the <code>mdro()</code> function:</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>x <span class="ot"><-</span> <span class="fu">mdro</span>(example_isolates,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="at">guideline =</span> custom)</span>
|
||||
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(x)</span>
|
||||
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> Negative Elderly Type A Elderly Type B</span></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1070 198 732</span></span></code></pre><p></p></div>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>x <span class="ot"><-</span> <span class="fu">mdro</span>(example_isolates,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> <span class="at">guideline =</span> custom)</span>
|
||||
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="fu">table</span>(x)</span>
|
||||
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="co">#> Negative Elderly Type A Elderly Type B</span></span>
|
||||
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a><span class="co">#> 1070 198 732</span></span></code></pre><p></p></div>
|
||||
<p>Rules can also be combined with other custom rules by using <code><a href="https://rdrr.io/r/base/c.html" class="external-link">c()</a></code>:</p>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>x <span class="ot"><-</span> <span class="fu">mdro</span>(example_isolates,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="at">guideline =</span> <span class="fu">c</span>(custom,</span>
|
||||
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">custom_mdro_guideline</span>(ERY <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">50</span> <span class="sc">~</span> <span class="st">"Elderly Type C"</span>)))</span>
|
||||
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(x)</span>
|
||||
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> Negative Elderly Type A Elderly Type B Elderly Type C</span></span>
|
||||
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> 961 198 732 109</span></span></code></pre><p></p></div>
|
||||
<p></p><div class="sourceCode"><pre><code><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>x <span class="ot"><-</span> <span class="fu">mdro</span>(example_isolates,</span>
|
||||
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> <span class="at">guideline =</span> <span class="fu">c</span>(custom,</span>
|
||||
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a> <span class="fu">custom_mdro_guideline</span>(ERY <span class="sc">==</span> <span class="st">"R"</span> <span class="sc">&</span> age <span class="sc">></span> <span class="dv">50</span> <span class="sc">~</span> <span class="st">"Elderly Type C"</span>)))</span>
|
||||
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="fu">table</span>(x)</span>
|
||||
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a><span class="co">#> Negative Elderly Type A Elderly Type B Elderly Type C</span></span>
|
||||
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a><span class="co">#> 961 198 732 109</span></span></code></pre><p></p></div>
|
||||
<p>The rules set (the <code>custom</code> object in this case) could be exported to a shared file location using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS()</a></code> if you collaborate with multiple users. The custom rules set could then be imported using <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">readRDS()</a></code>.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
|
Reference in New Issue
Block a user