<p>These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in <code>dplyr</code>s <code><ahref='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></code> and support grouped variables, see <em>Examples</em>.</p>
<p><code>count_R</code> and <code>count_IR</code> can be used to count resistant isolates, <code>count_S</code> and <code>count_SI</code> can be used to count susceptible isolates.<br/></p>
<td><p>one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with <code><ahref='as.rsi.html'>as.rsi</a></code> if needed.</p></td>
<td><p>a logical to indicate whether (in combination therapies) also observations should be included where not all antibiotics were tested, but at least one of the tested antibiotics contains a target interpretation (e.g. S in case of <code>portion_S</code> and R in case of <code>portion_R</code>). <strong>This would lead to selection bias in almost all cases.</strong></p></td>
<td><p>a column name of the <code><ahref='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><ahref='ab_property.html'>ab_property</a></code></p></td>
</tr>
<tr>
<th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><ahref='translate.html'>get_locale</a></code>) and can also be set with <code><ahref='https://www.rdocumentation.org/packages/base/topics/options'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
<td><p>a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter <code>combine_IR</code>, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is <code>TRUE</code>.</p></td>
<td><p>a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter <code>combine_SI</code>.</p></td>
<p>Wickham H. <strong>Tidy Data.</strong> The Journal of Statistical Software, vol. 59, 2014. <ahref='http://vita.had.co.nz/papers/tidy-data.html'>http://vita.had.co.nz/papers/tidy-data.html</a></p>
<p>These functions are meant to count isolates. Use the <code><ahref='portion.html'>portion</a>_*</code> functions to calculate microbial resistance.</p>
<p>The function <code>n_rsi</code> is an alias of <code>count_all</code>. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to <code><ahref='https://dplyr.tidyverse.org/reference/n_distinct.html'>n_distinct</a></code>. Their function is equal to <code>count_S(...) + count_IR(...)</code>.</p>
<p>The function <code>count_df</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><ahref='as.rsi.html'>as.rsi</a></code>) and counts the amounts of S, I and R. The resulting <em>tidy data</em> (see Source) <code>data.frame</code> will have three rows (S/I/R) and a column for each variable with class <code>"rsi"</code>.</p>
<p>The function <code>rsi_df</code> works exactly like <code>count_df</code>, but add the percentage of S, I and R.</p>
<h2class="hasAnchor"id="interpretation-of-s-i-and-r"><aclass="anchor"href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2>
<p>In 2019, EUCAST has decided to change the definitions of susceptibility testing categories S, I and R as shown below. Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
<p>Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.</p>
<p>On our website <ahref='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <ahref='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <ahref='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <ahref='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<spanclass='kw'>n1</span><spanclass='kw'>=</span><spanclass='fu'>count_all</span>(<spanclass='no'>CIP</span>), <spanclass='co'># the actual total; sum of all three</span>
<spanclass='kw'>n2</span><spanclass='kw'>=</span><spanclass='fu'>n_rsi</span>(<spanclass='no'>CIP</span>), <spanclass='co'># same - analogous to n_distinct</span>
<spanclass='kw'>total</span><spanclass='kw'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/n.html'>n</a></span>()) <spanclass='co'># NOT the number of tested isolates!</span>
<spanclass='fu'><ahref='https://www.rdocumentation.org/packages/base/topics/with'>with</a></span>(<spanclass='no'>septic_patients</span>, <spanclass='co'># n = 1798</span>
<p>Developed by <ahref='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <ahref='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <ahref='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <ahref='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <ahref='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>