knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7.15,
  fig.height = 4
)

options(knitr.kable.NA = '')

library(abxaware)

Introduction

AWaRe is a tool developed by the World Health Organization (WHO) to to help countries improve antibiotic treatment, increase access and reduce resistance (https://adoptaware.org/).

AWaRe was introduced in 2017 as a new categorization of antibiotics to guide prescriptions and treatment while monitoring consumption. The three categories are:

WHO suggests that countries should increase the proportion of access antibiotics to correspond to at least 60% of total national consumption

abxaware is an R package that contains a list of antibacterial drugs for systemic use (ATC group J01) and the corresponding AWaRe classification plus functions to aggregate and visualise antibiotic use according to AWaRe.

The classification data frame (abx_aware, see Appendix) contains both the latest 2019 WHO classification, the English classification (Budd 2019) and our own adaptation to Danish guidelines.

In the Danish classification, which is default in abxaware functions, two drugs have been moved up one level: amoxicillin and beta-lactamase inhibitor from access to watch and meropenem from watch to reserve. Additionally, two drugs (sulfapyridine and sulfadiazine) that are unclassified by WHO are included in the Danish AWaRe classification in order to cover nearly all antibiotics used in Danish hospitals.

awr_plot(abx_sales, 
         atc, 
         ddd, 
         ignore.other = TRUE,
         silent       = TRUE) +
  ggplot2::labs(title = 'Use of antibiotics in public, somatic hospitals in Denmark 2015-2021')

Preparing data

To create a plot like the one above, you need a data frame with at least two columns: ATC code and amount. The ATC code is the unique drug identifier, and the amount variable is the amount of drug with this ATC code used. Amount is normally given in defined daily dose (DDD) units, but other measures may be used. Additionally, the data frame may include variables for time period and organisational unit allowing for creation of faceted time series plots. Note that only drugs with a complete ATC code with 7 characters can be classified, and that not all drugs have been classified. Unclassifiable drugs appear in the outputs as "other" unless ignore.other = TRUE.

In the following examples we will use the abx_sales data frame. In addition to the atc and ddd columns, abx_sales has a time variable (month) and two unit variables (region and hospital). That is, for each month, atc group and hospital in one of five Danish regions the amount of drug used is found in the ddd variable.

library(abxaware)
dplyr::glimpse(abx_sales)

Plotting data

This code creates a single one-dimensional plot.

awr_plot(abx_sales, 
         atc = atc, 
         ddd = ddd)

awr_plot() automatically aggregates data and prints a message telling which classification was used, WHO, UK or DK. By default, the DK classification is used, but the method can be specified using the method argument.

awr_plot(abx_sales, method = 'who')
awr_plot(abx_sales, method = 'uk')

The default method for an R session may be specified in advance as an option, for example: options(abxaware.method = 'who').

To split data by organisational unit, provide a unit variable:

awr_plot(abx_sales, 
         atc, 
         ddd, 
         unit = region)

Likewise, to create a time series plot, provide a time variable:

awr_plot(abx_sales, 
         atc, 
         ddd, 
         time = month)

Or combine time and unit to create faceted time series plots.

awr_plot(abx_sales,
         atc, 
         ddd, 
         time = month, 
         unit = region, 
         ncol = 1)
awr_plot(abx_sales,
         atc, 
         ddd, 
         time = month, 
         unit = hospital, 
         ncol = 2)

The horizontal line represents the median percentage use of antibiotics in the access group. In case of non-random variation over time, the line is dashed, otherwise solid. To test for non-random variation two rules are employed for unusually long runs of consecutive data points on the same side of the centre line and unusually few crossings of the centre line respectively (Anhøj 2014)). If one or both test are positive, this may be taken as a signal that non-random variation (e.g. trends, shift, or cyclic patterns) is present.

To add title, subtitle, caption etc. to a plot, use the labs function from ggplot2. See ?awr_plot for details on other arguments.

awr_plot(abx_sales, 
         atc, 
         ddd, 
         time = month,
         ignore.other = TRUE,
         silent       = TRUE) +
  ggplot2::labs(title   = 'Use of antibiotics in Danish hospitals 2015-2020',
                x       = 'Month',
                caption = 'Created with abxaware for R')

Aggregating data

As mentioned, data are automatically aggregated before plotting with awr_plot(). If no time and unit arguments are provided, data will be aggregated by AWaRe class. However, when specifying a time and/or a unit argument data will be further aggregated accordingly. Aggregation is performed "behind the scenes" by the awr_aggregate() function. When plotting, only one time and/or one unit variable is allowed. But awr_aggregate() allows for indefinitely many (unnamed) grouping variables.

awr_aggregate(abx_sales,
              atc,
              ddd)
awr_aggregate(abx_sales,
              atc, 
              ddd, 
              region)
awr_aggregate(abx_sales,
              atc, 
              ddd, 
              region, 
              hospital,
              month)

References

Appendix: Table for mapping ATC codes to AWaRe groups

knitr::kable(abx_aware)


anhoej/abxaware documentation built on Feb. 8, 2024, 1:29 a.m.