2022-08-21 16:59:35 +02:00
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --> < html lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< meta charset = "utf-8" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
< meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" >
< meta name = "description" content = "AMR" >
< title > How to determine multi-drug resistance (MDR) • AMR (for R)< / title >
<!-- favicons --> < link rel = "icon" type = "image/png" sizes = "16x16" href = "../favicon-16x16.png" >
< link rel = "icon" type = "image/png" sizes = "32x32" href = "../favicon-32x32.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "180x180" href = "../apple-touch-icon.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "120x120" href = "../apple-touch-icon-120x120.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "76x76" href = "../apple-touch-icon-76x76.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "60x60" href = "../apple-touch-icon-60x60.png" >
< script src = "../deps/jquery-3.6.0/jquery-3.6.0.min.js" > < / script > < meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" >
2023-12-03 01:14:24 +01:00
< link href = "../deps/bootstrap-5.3.1/bootstrap.min.css" rel = "stylesheet" >
2024-04-05 16:58:51 +02:00
< script src = "../deps/bootstrap-5.3.1/bootstrap.bundle.min.js" > < / script > < link href = "../deps/Lato-0.4.9/font.css" rel = "stylesheet" >
< link href = "../deps/Fira_Code-0.4.9/font.css" rel = "stylesheet" >
2022-08-21 16:59:35 +02:00
<!-- Font Awesome icons --> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity = "sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin = "anonymous" >
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity = "sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin = "anonymous" >
2024-04-23 10:39:01 +02:00
<!-- bootstrap - toc --> < script src = "https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity = "sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin = "anonymous" > < / script > <!-- headroom.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity = "sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity = "sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin = "anonymous" > < / script > <!-- clipboard.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js" integrity = "sha512-7O5pXpc0oCRrxk8RUfDYFgn0nO1t+jLuIOQdOMRp4APB7uZ4vSjspzp5y6YDtDs4VzUSTbWzBFZ/LKJhnyFOKw==" crossorigin = "anonymous" referrerpolicy = "no-referrer" > < / script > <!-- search --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity = "sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity = "sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity = "sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin = "anonymous" > < / script > <!-- pkgdown --> < script src = "../pkgdown.js" > < / script > < link href = "../extra.css" rel = "stylesheet" >
2022-08-21 16:59:35 +02:00
< script src = "../extra.js" > < / script > < meta property = "og:title" content = "How to determine multi-drug resistance (MDR)" >
< meta property = "og:description" content = "AMR" >
< meta property = "og:image" content = "https://msberends.github.io/AMR/logo.svg" >
< meta name = "twitter:card" content = "summary_large_image" >
< meta name = "twitter:creator" content = "@msberends" >
2022-10-05 12:32:07 +02:00
< meta name = "twitter:site" content = "@msberends" >
2022-08-21 16:59:35 +02:00
<!-- mathjax --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity = "sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity = "sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin = "anonymous" > < / script > <!-- [if lt IE 9]>
< script src = "https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js" > < / script >
< script src = "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" > < / script >
<![endif]-->
< / head >
< body >
< a href = "#main" class = "visually-hidden-focusable" > Skip to contents< / a >
2024-04-19 10:24:46 +02:00
< nav class = "navbar fixed-top navbar-dark navbar-expand-lg bg-primary" data-bs-theme = "dark" > < div class = "container" >
2022-08-21 16:59:35 +02:00
< a class = "navbar-brand me-2" href = "../index.html" > AMR (for R)< / a >
2024-05-30 16:45:24 +02:00
< small class = "nav-text text-muted me-auto" data-bs-toggle = "tooltip" data-bs-placement = "bottom" title = "" > 2.1.1.9035< / small >
2022-08-21 16:59:35 +02:00
< button class = "navbar-toggler" type = "button" data-bs-toggle = "collapse" data-bs-target = "#navbar" aria-controls = "navbar" aria-expanded = "false" aria-label = "Toggle navigation" >
< span class = "navbar-toggler-icon" > < / span >
< / button >
< div id = "navbar" class = "collapse navbar-collapse ms-3" >
< ul class = "navbar-nav me-auto" >
< li class = "active nav-item dropdown" >
< a href = "#" class = "nav-link dropdown-toggle" data-bs-toggle = "dropdown" role = "button" aria-expanded = "false" aria-haspopup = "true" id = "dropdown--how-to" >
< span class = "fa fa-question-circle" > < / span >
How to
< / a >
< div class = "dropdown-menu" aria-labelledby = "dropdown--how-to" >
< a class = "dropdown-item" href = "../articles/AMR.html" >
< span class = "fa fa-directions" > < / span >
2023-01-23 20:14:37 +01:00
Conduct AMR Analysis
2022-08-21 16:59:35 +02:00
< / a >
2023-02-08 17:01:47 +01:00
< a class = "dropdown-item" href = "../reference/antibiogram.html" >
< span class = "fa fa-file-prescription" > < / span >
Generate Antibiogram (Trad./Syndromic/WISCA)
< / a >
2022-08-21 16:59:35 +02:00
< a class = "dropdown-item" href = "../articles/resistance_predict.html" >
< span class = "fa fa-dice" > < / span >
2023-01-23 20:14:37 +01:00
Predict Antimicrobial Resistance
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../articles/datasets.html" >
< span class = "fa fa-database" > < / span >
2023-02-26 21:34:01 +01:00
Download Data Sets for Own Use
< / a >
< a class = "dropdown-item" href = "../reference/AMR-options.html" >
< span class = "fa fa-gear" > < / span >
Set User- Or Team-specific Package Settings
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../articles/PCA.html" >
< span class = "fa fa-compress" > < / span >
2023-01-23 20:14:37 +01:00
Conduct Principal Component Analysis for AMR
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../articles/MDR.html" >
< span class = "fa fa-skull-crossbones" > < / span >
2023-01-23 20:14:37 +01:00
Determine Multi-Drug Resistance (MDR)
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../articles/WHONET.html" >
< span class = "fa fa-globe-americas" > < / span >
2023-01-23 20:14:37 +01:00
Work with WHONET Data
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../articles/EUCAST.html" >
< span class = "fa fa-exchange-alt" > < / span >
2023-01-23 20:14:37 +01:00
Apply Eucast Rules
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../reference/mo_property.html" >
< span class = "fa fa-bug" > < / span >
2023-01-23 20:14:37 +01:00
Get Taxonomy of a Microorganism
2022-08-21 16:59:35 +02:00
< / a >
< a class = "dropdown-item" href = "../reference/ab_property.html" >
< span class = "fa fa-capsules" > < / span >
2023-01-23 20:14:37 +01:00
Get Properties of an Antibiotic Drug
2022-08-21 16:59:35 +02:00
< / a >
2022-11-13 08:54:32 +01:00
< a class = "dropdown-item" href = "../reference/av_property.html" >
< span class = "fa fa-capsules" > < / span >
2023-01-23 20:14:37 +01:00
Get Properties of an Antiviral Drug
2022-11-13 08:54:32 +01:00
< / a >
2022-08-21 16:59:35 +02:00
< / div >
< / li >
2023-05-24 16:03:18 +02:00
< li class = "nav-item dropdown" >
< a href = "#" class = "nav-link dropdown-toggle" data-bs-toggle = "dropdown" role = "button" aria-expanded = "false" aria-haspopup = "true" id = "dropdown--with-other-pkgs" >
2023-05-27 10:53:23 +02:00
< span class = "fa fa-layer-group" > < / span >
2023-05-24 16:03:18 +02:00
With other pkgs
< / a >
< div class = "dropdown-menu" aria-labelledby = "dropdown--with-other-pkgs" >
< a class = "dropdown-item" href = "../articles/other_pkg.html" >
2023-05-27 10:53:23 +02:00
< span class = "fa fa-layer-group" > < / span >
2023-05-24 16:03:18 +02:00
AMR & dplyr/tidyverse
< / a >
< a class = "dropdown-item" href = "../articles/other_pkg.html" >
2023-05-27 10:53:23 +02:00
< span class = "fa fa-layer-group" > < / span >
2023-05-24 16:03:18 +02:00
AMR & data.table
< / a >
< a class = "dropdown-item" href = "../articles/other_pkg.html" >
2023-05-27 10:53:23 +02:00
< span class = "fa fa-layer-group" > < / span >
2023-05-24 16:03:18 +02:00
AMR & tidymodels
< / a >
< a class = "dropdown-item" href = "../articles/other_pkg.html" >
2023-05-27 10:53:23 +02:00
< span class = "fa fa-layer-group" > < / span >
2023-05-24 16:03:18 +02:00
AMR & base R
< / a >
< / div >
< / li >
2022-08-21 16:59:35 +02:00
< li class = "nav-item" >
< a class = "nav-link" href = "../reference/index.html" >
< span class = "fa fa-book-open" > < / span >
Manual
< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link" href = "../authors.html" >
< span class = "fa fa-users" > < / span >
Authors
< / a >
< / li >
2023-05-24 16:03:18 +02:00
< / ul >
< form class = "form-inline my-2 my-lg-0" role = "search" >
< input type = "search" class = "form-control me-sm-2" aria-label = "Toggle navigation" name = "search-input" data-search-index = "../search.json" id = "search-input" placeholder = "Search for" autocomplete = "off" >
< / form >
< ul class = "navbar-nav" >
2022-08-21 16:59:35 +02:00
< li class = "nav-item" >
< a class = "nav-link" href = "../news/index.html" >
< span class = "far fa far fa-newspaper" > < / span >
Changelog
< / a >
< / li >
< li class = "nav-item" >
< a class = "external-link nav-link" href = "https://github.com/msberends/AMR" >
< span class = "fab fa fab fa-github" > < / span >
Source Code
< / a >
< / li >
< / ul >
< / div >
< / div >
< / nav > < div class = "container template-article" >
< div class = "row" >
< main id = "main" class = "col-md-9" > < div class = "page-header" >
< img src = "../logo.svg" class = "logo" alt = "" > < h1 > How to determine multi-drug resistance (MDR)< / h1 >
< small class = "dont-index" > Source: < a href = "https://github.com/msberends/AMR/blob/HEAD/vignettes/MDR.Rmd" class = "external-link" > < code > vignettes/MDR.Rmd< / code > < / a > < / small >
< div class = "d-none name" > < code > MDR.Rmd< / code > < / div >
< / div >
2022-10-29 14:24:08 +02:00
< p > With the function < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > , you can determine which
micro-organisms are multi-drug resistant organisms (MDRO).< / p >
2022-08-21 16:59:35 +02:00
< div class = "section level3" >
< h3 id = "type-of-input" > Type of input< a class = "anchor" aria-label = "anchor" href = "#type-of-input" > < / a >
< / h3 >
2022-10-29 14:24:08 +02:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function takes a data set as input, such as a
regular < code > data.frame< / code > . It tries to automatically determine the
right columns for info about your isolates, such as the name of the
species and all columns with results of antimicrobial agents. See the
help page for more info about how to set the right settings for your
data with the command < code > < a href = "../reference/mdro.html" > ?mdro< / a > < / code > .< / p >
< p > For WHONET data (and most other data), all settings are automatically
set correctly.< / p >
2022-08-21 16:59:35 +02:00
< / div >
< div class = "section level3" >
< h3 id = "guidelines" > Guidelines< a class = "anchor" aria-label = "anchor" href = "#guidelines" > < / a >
< / h3 >
2022-10-29 14:24:08 +02:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function support multiple guidelines. You can
select a guideline with the < code > guideline< / code > parameter. Currently
supported guidelines are (case-insensitive):< / p >
2022-08-21 16:59:35 +02:00
< ul >
< li >
< p > < code > guideline = "CMI2012"< / code > (default)< / p >
2022-10-29 14:24:08 +02:00
< p > Magiorakos AP, Srinivasan A < em > et al.< / em > “Multidrug-resistant,
extensively drug-resistant and pandrug-resistant bacteria: an
international expert proposal for interim standard definitions for
acquired resistance.” Clinical Microbiology and Infection (2012) (< a href = "https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext" class = "external-link" > link< / a > )< / p >
2022-08-21 16:59:35 +02:00
< / li >
< li >
2022-10-29 14:24:08 +02:00
< p > < code > guideline = "EUCAST3.2"< / code > (or simply
< code > guideline = "EUCAST"< / code > )< / p >
< p > The European international guideline - EUCAST Expert Rules Version
3.2 “Intrinsic Resistance and Unusual Phenotypes” (< a href = "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" class = "external-link" > link< / a > )< / p >
2022-08-21 16:59:35 +02:00
< / li >
< li >
< p > < code > guideline = "EUCAST3.1"< / code > < / p >
2022-10-29 14:24:08 +02:00
< p > The European international guideline - EUCAST Expert Rules Version
3.1 “Intrinsic Resistance and Exceptional Phenotypes Tables” (< a href = "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" class = "external-link" > link< / a > )< / p >
2022-08-21 16:59:35 +02:00
< / li >
< li >
< p > < code > guideline = "TB"< / code > < / p >
2022-10-29 14:24:08 +02:00
< p > The international guideline for multi-drug resistant tuberculosis -
World Health Organization “Companion handbook to the WHO guidelines for
the programmatic management of drug-resistant tuberculosis” (< a href = "https://www.who.int/tb/publications/pmdt_companionhandbook/en/" class = "external-link" > link< / a > )< / p >
2022-08-21 16:59:35 +02:00
< / li >
< li >
< p > < code > guideline = "MRGN"< / code > < / p >
2022-10-29 14:24:08 +02:00
< p > The German national guideline - Mueller < em > et al.< / em > (2015)
Antimicrobial Resistance and Infection Control 4:7. DOI:
10.1186/s13756-015-0047-6< / p >
2022-08-21 16:59:35 +02:00
< / li >
< li >
< p > < code > guideline = "BRMO"< / code > < / p >
2022-10-29 14:24:08 +02:00
< p > The Dutch national guideline - Rijksinstituut voor Volksgezondheid en
Milieu “WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen)
(ZKH)” (< a href = "https://www.rivm.nl/wip-richtlijn-brmo-bijzonder-resistente-micro-organismen-zkh" class = "external-link" > link< / a > )< / p >
2022-08-21 16:59:35 +02:00
< / li >
< / ul >
2022-10-29 14:24:08 +02:00
< p > Please suggest your own (country-specific) guidelines by letting us
know: < a href = "https://github.com/msberends/AMR/issues/new" class = "external-link uri" > https://github.com/msberends/AMR/issues/new< / a > .< / p >
2022-08-21 16:59:35 +02:00
< div class = "section level4" >
< h4 id = "custom-guidelines" > Custom Guidelines< a class = "anchor" aria-label = "anchor" href = "#custom-guidelines" > < / a >
< / h4 >
2022-10-29 14:24:08 +02:00
< p > You can also use your own custom guideline. Custom guidelines can be
set with the < code > < a href = "../reference/mdro.html" > custom_mdro_guideline()< / a > < / 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 < code > < a href = "https://dplyr.tidyverse.org/reference/case_when.html" class = "external-link" > case_when()< / a > < / code > of the
< code > dplyr< / code > package, you will recognise the input method to set
your own rules. Rules must be set using what R considers to be the
‘ formula notation’ :< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb1" > < pre class = "downlit sourceCode r" >
2022-08-28 22:45:38 +02:00
< code class = "sourceCode R" > < span > < span class = "va" > custom< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > custom_mdro_guideline< / a > < / span > < span class = "op" > (< / span > < / span >
< span > < span class = "va" > CIP< / span > < span class = "op" > ==< / span > < span class = "st" > "R"< / span > < span class = "op" > & < / span > < span class = "va" > age< / span > < span class = "op" > > < / span > < span class = "fl" > 60< / span > < span class = "op" > ~< / span > < span class = "st" > "Elderly Type A"< / span > ,< / span >
< span > < span class = "va" > ERY< / span > < span class = "op" > ==< / span > < span class = "st" > "R"< / span > < span class = "op" > & < / span > < span class = "va" > age< / span > < span class = "op" > > < / span > < span class = "fl" > 60< / span > < span class = "op" > ~< / span > < span class = "st" > "Elderly Type B"< / span > < / span >
< span > < span class = "op" > )< / span > < / span > < / code > < / pre > < / div >
2022-10-29 14:24:08 +02:00
< 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
maximum 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 >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb2" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span > < span class = "va" > custom< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> A set of custom MDRO rules:< / span > < / span >
< span > < span class = "co" > #> 1. If CIP is "R" and age is higher than 60 then: Elderly Type A< / span > < / span >
< span > < span class = "co" > #> 2. If ERY is "R" and age is higher than 60 then: Elderly Type B< / span > < / span >
< span > < span class = "co" > #> 3. Otherwise: Negative< / span > < / span >
< span > < span class = "co" > #> < / span > < / span >
< span > < span class = "co" > #> Unmatched rows will return NA.< / span > < / span >
< span > < span class = "co" > #> Results will be of class 'factor', with ordered levels: Negative < Elderly Type A < Elderly Type B< / span > < / span > < / code > < / pre > < / div >
2022-10-29 14:24:08 +02:00
< p > The outcome of the function can be used for the
< code > guideline< / code > argument in the < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function:< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb3" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span > < span class = "va" > x< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "va" > example_isolates< / span > , guideline < span class = "op" > =< / span > < span class = "va" > custom< / span > < span class = "op" > )< / span > < / span >
< span > < span class = "fu" > < a href = "https://rdrr.io/r/base/table.html" class = "external-link" > table< / a > < / span > < span class = "op" > (< / span > < span class = "va" > x< / span > < span class = "op" > )< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> x< / span > < / span >
< span > < span class = "co" > #> Negative Elderly Type A Elderly Type B < / span > < / span >
< span > < span class = "co" > #> 1070 198 732< / span > < / span > < / code > < / pre > < / div >
2022-10-29 14:24:08 +02:00
< 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 >
2022-08-21 16:59:35 +02:00
< / div >
< / div >
< div class = "section level3" >
< h3 id = "examples" > Examples< a class = "anchor" aria-label = "anchor" href = "#examples" > < / a >
< / h3 >
2022-10-29 14:24:08 +02:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function always returns an ordered
< code > factor< / code > for predefined guidelines. For example, the output
of the default guideline by Magiorakos < em > et al.< / em > returns a
< code > factor< / code > with levels ‘ Negative’ , ‘ MDR’ , ‘ XDR’ or ‘ PDR’ in
that order.< / p >
< p > The next example uses the < code > example_isolates< / code > data set.
This is a data set included with this package and contains full
antibiograms of 2,000 microbial isolates. It reflects reality and can be
used to practise AMR data analysis. If we test the MDR/XDR/PDR guideline
on this data set, we get:< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb4" > < pre class = "downlit sourceCode r" >
2022-08-28 22:45:38 +02:00
< code class = "sourceCode R" > < span > < span class = "kw" > < a href = "https://rdrr.io/r/base/library.html" class = "external-link" > library< / a > < / span > < span class = "op" > (< / span > < span class = "va" > < a href = "https://dplyr.tidyverse.org" class = "external-link" > dplyr< / a > < / span > < span class = "op" > )< / span > < span class = "co" > # to support pipes: %> %< / span > < / span >
2022-10-29 14:24:08 +02:00
< span > < span class = "kw" > < a href = "https://rdrr.io/r/base/library.html" class = "external-link" > library< / a > < / span > < span class = "op" > (< / span > < span class = "va" > < a href = "https://msberends.github.io/cleaner/" class = "external-link" > cleaner< / a > < / span > < span class = "op" > )< / span > < span class = "co" > # to create frequency tables< / span > < / span > < / code > < / pre > < / div >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb5" > < pre class = "downlit sourceCode r" >
2022-08-28 22:45:38 +02:00
< code class = "sourceCode R" > < span > < span class = "va" > example_isolates< / span > < span class = "op" > < a href = "https://magrittr.tidyverse.org/reference/pipe.html" class = "external-link" > %> %< / a > < / span > < / span >
< span > < span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "op" > )< / span > < span class = "op" > < a href = "https://magrittr.tidyverse.org/reference/pipe.html" class = "external-link" > %> %< / a > < / span > < / span >
2022-10-29 14:24:08 +02:00
< span > < span class = "fu" > < a href = "https://msberends.github.io/cleaner/reference/freq.html" class = "external-link" > freq< / a > < / span > < span class = "op" > (< / span > < span class = "op" > )< / span > < span class = "co" > # show frequency table of the result< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> Warning: in mdro(): NA introduced for isolates where the available percentage of< / span > < / span >
< span > < span class = "co" > #> antimicrobial classes was below 50% (set with pct_required_classes)< / span > < / span > < / code > < / pre > < / div >
2022-08-21 16:59:35 +02:00
< p > < strong > Frequency table< / strong > < / p >
< p > Class: factor > ordered (numeric)< br >
Length: 2,000< br >
2022-10-29 14:24:08 +02:00
Levels: 4: Negative < Multi-drug-resistant (MDR) < Extensively
drug-resistant …< br >
2022-08-21 16:59:35 +02:00
Available: 1,729 (86.45%, NA: 271 = 13.55%)< br >
Unique: 2< / p >
2022-10-29 14:24:08 +02:00
< table style = "width:100%;" class = "table" >
< colgroup >
< col width = "4%" >
< col width = "38%" >
< col width = "9%" >
< col width = "12%" >
< col width = "16%" >
< col width = "19%" >
< / colgroup >
2022-08-21 16:59:35 +02:00
< thead > < tr class = "header" >
< th align = "left" > < / th >
< th align = "left" > Item< / th >
< th align = "right" > Count< / th >
< th align = "right" > Percent< / th >
< th align = "right" > Cum. Count< / th >
< th align = "right" > Cum. Percent< / th >
< / tr > < / thead >
< tbody >
< tr class = "odd" >
< td align = "left" > 1< / td >
< td align = "left" > Negative< / td >
< td align = "right" > 1601< / td >
2022-10-29 14:24:08 +02:00
< td align = "right" > 92.6%< / td >
2022-08-21 16:59:35 +02:00
< td align = "right" > 1601< / td >
2022-10-29 14:24:08 +02:00
< td align = "right" > 92.6%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< tr class = "even" >
< td align = "left" > 2< / td >
< td align = "left" > Multi-drug-resistant (MDR)< / td >
< td align = "right" > 128< / td >
2022-10-29 14:24:08 +02:00
< td align = "right" > 7.4%< / td >
2022-08-21 16:59:35 +02:00
< td align = "right" > 1729< / td >
2022-10-29 14:24:08 +02:00
< td align = "right" > 100.0%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< / tbody >
< / table >
2022-10-29 14:24:08 +02:00
< p > For another example, I will create a data set to determine multi-drug
resistant TB:< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb6" > < pre class = "downlit sourceCode r" >
2023-01-21 23:53:21 +01:00
< code class = "sourceCode R" > < span > < span class = "co" > # random_sir() is a helper function to generate< / span > < / span >
2022-08-21 16:59:35 +02:00
< span > < span class = "co" > # a random vector with values S, I and R< / span > < / span >
2022-08-28 22:45:38 +02:00
< span > < span class = "va" > my_TB_data< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "https://rdrr.io/r/base/data.frame.html" class = "external-link" > data.frame< / a > < / span > < span class = "op" > (< / span > < / span >
2023-01-21 23:53:21 +01:00
< span > rifampicin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > isoniazid < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > gatifloxacin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > ethambutol < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > pyrazinamide < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > moxifloxacin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > kanamycin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > < / span >
2022-08-28 22:45:38 +02:00
< span > < span class = "op" > )< / span > < / span > < / code > < / pre > < / div >
2022-10-29 14:24:08 +02:00
< p > Because all column names are automatically verified for valid drug
names or codes, this would have worked exactly the same way:< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb7" > < pre class = "downlit sourceCode r" >
2022-08-28 22:45:38 +02:00
< code class = "sourceCode R" > < span > < span class = "va" > my_TB_data< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "https://rdrr.io/r/base/data.frame.html" class = "external-link" > data.frame< / a > < / span > < span class = "op" > (< / span > < / span >
2023-01-21 23:53:21 +01:00
< span > RIF < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > INH < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > GAT < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > ETH < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > PZA < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > MFX < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,< / span >
< span > KAN < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_sir< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > < / span >
2022-08-28 22:45:38 +02:00
< span > < span class = "op" > )< / span > < / span > < / code > < / pre > < / div >
2022-08-21 16:59:35 +02:00
< p > The data set now looks like this:< / p >
< div class = "sourceCode" id = "cb8" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span > < span class = "fu" > < a href = "https://rdrr.io/r/utils/head.html" class = "external-link" > head< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > )< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin< / span > < / span >
2024-04-19 10:24:46 +02:00
< span > < span class = "co" > #> 1 I R S S S S< / span > < / span >
< span > < span class = "co" > #> 2 S S I R R S< / span > < / span >
< span > < span class = "co" > #> 3 R I I I R I< / span > < / span >
< span > < span class = "co" > #> 4 I S S S S S< / span > < / span >
< span > < span class = "co" > #> 5 I I I S I S< / span > < / span >
< span > < span class = "co" > #> 6 R S R S I I< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> kanamycin< / span > < / span >
2024-04-19 10:24:46 +02:00
< span > < span class = "co" > #> 1 R< / span > < / span >
< span > < span class = "co" > #> 2 I< / span > < / span >
2024-04-08 10:04:57 +02:00
< span > < span class = "co" > #> 3 S< / span > < / span >
2024-04-19 10:24:46 +02:00
< span > < span class = "co" > #> 4 I< / span > < / span >
2024-04-08 10:04:57 +02:00
< span > < span class = "co" > #> 5 I< / span > < / span >
2024-04-19 10:24:46 +02:00
< span > < span class = "co" > #> 6 I< / span > < / span > < / code > < / pre > < / div >
2022-10-29 14:24:08 +02:00
< p > We can now add the interpretation of MDR-TB to our data set. You can
use:< / p >
2022-08-21 16:59:35 +02:00
< div class = "sourceCode" id = "cb9" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span > < span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > , guideline < span class = "op" > =< / span > < span class = "st" > "TB"< / span > < span class = "op" > )< / span > < / span > < / code > < / pre > < / div >
< p > or its shortcut < code > < a href = "../reference/mdro.html" > mdr_tb()< / a > < / code > :< / p >
< div class = "sourceCode" id = "cb10" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span > < span class = "va" > my_TB_data< / span > < span class = "op" > $< / span > < span class = "va" > mdr< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > mdr_tb< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > )< / span > < / span >
2023-02-18 13:17:35 +01:00
< span > < span class = "co" > #> ℹ No column found as input for col_mo, assuming all rows contain< / span > < / span >
< span > < span class = "co" > #> Mycobacterium tuberculosis.< / span > < / span > < / code > < / pre > < / div >
2022-08-21 16:59:35 +02:00
< p > Create a frequency table of the results:< / p >
< div class = "sourceCode" id = "cb11" > < pre class = "downlit sourceCode r" >
2022-10-29 14:24:08 +02:00
< code class = "sourceCode R" > < span > < span class = "fu" > < a href = "https://msberends.github.io/cleaner/reference/freq.html" class = "external-link" > freq< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > $< / span > < span class = "va" > mdr< / span > < span class = "op" > )< / span > < / span > < / code > < / pre > < / div >
2022-08-21 16:59:35 +02:00
< p > < strong > Frequency table< / strong > < / p >
< p > Class: factor > ordered (numeric)< br >
Length: 5,000< br >
2022-10-29 14:24:08 +02:00
Levels: 5: Negative < Mono-resistant < Poly-resistant <
Multi-drug-resistant < …< br >
Available: 5,000 (100%, NA: 0 = 0%)< br >
2022-08-21 16:59:35 +02:00
Unique: 5< / p >
2022-10-29 14:24:08 +02:00
< table style = "width:100%;" class = "table" >
< colgroup >
< col width = "4%" >
< col width = "38%" >
< col width = "9%" >
< col width = "12%" >
< col width = "16%" >
< col width = "19%" >
< / colgroup >
2022-08-21 16:59:35 +02:00
< thead > < tr class = "header" >
< th align = "left" > < / th >
< th align = "left" > Item< / th >
< th align = "right" > Count< / th >
< th align = "right" > Percent< / th >
< th align = "right" > Cum. Count< / th >
< th align = "right" > Cum. Percent< / th >
< / tr > < / thead >
< tbody >
< tr class = "odd" >
< td align = "left" > 1< / td >
< td align = "left" > Mono-resistant< / td >
2024-04-19 10:24:46 +02:00
< td align = "right" > 3223< / td >
< td align = "right" > 64.46%< / td >
< td align = "right" > 3223< / td >
< td align = "right" > 64.46%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< tr class = "even" >
< td align = "left" > 2< / td >
< td align = "left" > Negative< / td >
2024-04-19 10:24:46 +02:00
< td align = "right" > 967< / td >
< td align = "right" > 19.34%< / td >
< td align = "right" > 4190< / td >
< td align = "right" > 83.80%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< tr class = "odd" >
< td align = "left" > 3< / td >
< td align = "left" > Multi-drug-resistant< / td >
2024-04-19 10:24:46 +02:00
< td align = "right" > 454< / td >
< td align = "right" > 9.08%< / td >
< td align = "right" > 4644< / td >
< td align = "right" > 92.88%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< tr class = "even" >
< td align = "left" > 4< / td >
< td align = "left" > Poly-resistant< / td >
2024-04-19 10:24:46 +02:00
< td align = "right" > 245< / td >
< td align = "right" > 4.90%< / td >
< td align = "right" > 4889< / td >
< td align = "right" > 97.78%< / td >
2022-08-21 16:59:35 +02:00
< / tr >
< tr class = "odd" >
< td align = "left" > 5< / td >
< td align = "left" > Extensively drug-resistant< / td >
2024-04-19 10:24:46 +02:00
< td align = "right" > 111< / td >
< td align = "right" > 2.22%< / td >
2022-08-21 16:59:35 +02:00
< td align = "right" > 5000< / td >
< td align = "right" > 100.00%< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / main > < aside class = "col-md-3" > < nav id = "toc" > < h2 > On this page< / h2 >
< / nav > < / aside >
< / div >
< footer > < div class = "pkgdown-footer-left" >
2024-04-23 10:39:01 +02:00
< p > < code > AMR< / code > (for R). Free and open-source, licenced under the < a target = "_blank" href = "https://github.com/msberends/AMR/blob/main/LICENSE" class = "external-link" > GNU General Public License version 2.0 (GPL-2)< / a > .< br > Developed at the < a target = "_blank" href = "https://www.rug.nl" class = "external-link" > University of Groningen< / a > and < a target = "_blank" href = "https://www.umcg.nl" class = "external-link" > University Medical Center Groningen< / a > in The Netherlands.< / p >
2022-08-21 16:59:35 +02:00
< / div >
< div class = "pkgdown-footer-right" >
2024-04-23 10:39:01 +02:00
< p > < a target = "_blank" href = "https://www.rug.nl" class = "external-link" > < img src = "https://github.com/msberends/AMR/raw/main/pkgdown/logos/logo_rug.svg" style = "max-width: 150px;" > < / a > < a target = "_blank" href = "https://www.umcg.nl" class = "external-link" > < img src = "https://github.com/msberends/AMR/raw/main/pkgdown/logos/logo_umcg.svg" style = "max-width: 150px;" > < / a > < / p >
2022-08-21 16:59:35 +02:00
< / div >
< / footer >
< / div >
< / body >
< / html >