<p>These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in <code><ahref='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code> from the <code>dplyr</code> package and also support grouped variables, please see <em>Examples</em>.</p>
<p><code>resistance()</code> should be used to calculate resistance, <code>susceptibility()</code> should be used to calculate susceptibility.<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. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.</p></td>
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
</tr>
<tr>
<th>as_percent</th>
<td><p>a logical to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of <code>0.123456</code> will then be returned as <code>"12.3%"</code>.</p></td>
<td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination therapy</em> below</p></td>
<td><p>a <ahref='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing columns with class <code><ahref='as.rsi.html'>rsi</a></code> (see <code><ahref='as.rsi.html'>as.rsi()</a></code>)</p></td>
<td><p>a column name of the <ahref='antibiotics.html'>antibiotics</a> data set to translate the antibiotic abbreviations to, using <code><ahref='ab_property.html'>ab_property()</a></code>. Use a value</p></td>
<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://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></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>
</tr>
<tr>
<th>combine_IR</th>
<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><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <ahref='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<p>A <ahref='https://rdrr.io/r/base/double.html'>double</a> or, when <code>as_percent = TRUE</code>, a <ahref='https://rdrr.io/r/base/character.html'>character</a>.</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><strong>Remember that you should filter your table to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><ahref='first_isolate.html'>first_isolate()</a></code> to determine them in your data set.</p>
<p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><ahref='count.html'>count()</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code>count_susceptible() / count_all()</code>. <em>Low counts can influence the outcome - the <code>proportion</code> functions may camouflage this, since they only return the proportion (albeit being dependent on the <code>minimum</code> parameter).</em></p>
<p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code><ahref='as.rsi.html'>rsi</a></code> class (created with <code><ahref='as.rsi.html'>as.rsi()</a></code>) and calculates the proportions R, I and S. It also supports grouped variables. The function <code>rsi_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p>
<p>When using more than one variable for <code>...</code> (= combination therapy), use <code>only_all_tested</code> to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how <code>susceptibility()</code> works to calculate the %SI:</p><pre>--------------------------------------------------------------------
The <ahref='lifecycle.html'>lifecycle</a> of this function is <strong>stable</strong>. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.</p>
<p>If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.</p>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories R and S/I as shown below (<ahref='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>).</p><ul>
A microorganism is categorised as <em>Resistant</em> when there is a high likelihood of therapeutic failure even when there is increased exposure. 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></li>
<li><p><strong>S = Susceptible</strong><br/>
A microorganism is categorised as <em>Susceptible, standard dosing regimen</em>, when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I = Increased exposure, but still susceptible</strong><br/>
A microorganism is categorised as <em>Susceptible, Increased exposure</em> 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>
<p>This AMR package honours this new insight. Use <code>susceptibility()</code> (equal to <code>proportion_SI()</code>) to determine antimicrobial susceptibility and <code><ahref='count.html'>count_susceptible()</a></code> (equal to <code><ahref='count.html'>count_SI()</a></code>) to count susceptible isolates.</p>
<p>On our website <ahref='https://msberends.github.io/AMR'>https://msberends.github.io/AMR</a> you can find <ahref='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <ahref='https://msberends.github.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <ahref='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <ahref='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
n = <spanclass='fu'><ahref='count.html'>n_rsi</a></span>(<spanclass='kw'>CIP</span>)) <spanclass='co'># n_rsi works like n_distinct in dplyr, see ?n_rsi</span>
SI = <spanclass='fu'>susceptibility</span>(<spanclass='kw'>CIP</span>, as_percent = <spanclass='fl'>TRUE</span>),
n1 = <spanclass='fu'><ahref='count.html'>count_all</a></span>(<spanclass='kw'>CIP</span>), <spanclass='co'># the actual total; sum of all three</span>
n2 = <spanclass='fu'><ahref='count.html'>n_rsi</a></span>(<spanclass='kw'>CIP</span>), <spanclass='co'># same - analogous to n_distinct</span>
total = <spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/context.html'>n</a></span>()) <spanclass='co'># NOT the number of tested isolates!</span>
<spanclass='kw'>example_isolates</span><spanclass='op'>%>%</span><spanclass='fu'><ahref='count.html'>count_all</a></span>(<spanclass='kw'>AMC</span>) <spanclass='co'># n = 1879</span>
<spanclass='kw'>example_isolates</span><spanclass='op'>%>%</span><spanclass='fu'><ahref='count.html'>count_all</a></span>(<spanclass='kw'>GEN</span>) <spanclass='co'># n = 1855</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/a.w.friedrich/'>Alexander W. Friedrich</a>, <ahref='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>, <ahref='https://www.rug.nl/staff/c.j.albers/'>Casper J. Albers</a>, <ahref='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>