diff --git a/404.html b/404.html index 9ce965421..6871b294a 100644 --- a/404.html +++ b/404.html @@ -21,6 +21,8 @@ + + Skip to contents diff --git a/LICENSE-text.html b/LICENSE-text.html index 2e510a1a3..ed8020eab 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -1,5 +1,5 @@ -License • AMR (for R) +License • AMR (for R) Skip to contents diff --git a/articles/AMR.html b/articles/AMR.html index 1065dbc4c..bf7685dc1 100644 --- a/articles/AMR.html +++ b/articles/AMR.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/AMR_for_Python.html b/articles/AMR_for_Python.html index 32d14dffc..debf9fb6c 100644 --- a/articles/AMR_for_Python.html +++ b/articles/AMR_for_Python.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/AMR_with_tidymodels.html b/articles/AMR_with_tidymodels.html index 434bac5c8..9a2d26b27 100644 --- a/articles/AMR_with_tidymodels.html +++ b/articles/AMR_with_tidymodels.html @@ -20,6 +20,8 @@ + + Skip to contents @@ -140,7 +142,7 @@ package.

#> dplyr::filter() masks stats::filter() #> dplyr::lag() masks stats::lag() #> recipes::step() masks stats::step() -#> Use tidymodels_prefer() to resolve common conflicts. +#> Use suppressPackageStartupMessages() to eliminate package startup messages library(AMR) # For AMR data analysis # Load the example_isolates dataset diff --git a/articles/EUCAST.html b/articles/EUCAST.html index eb4a75a97..523114794 100644 --- a/articles/EUCAST.html +++ b/articles/EUCAST.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/MDR.html b/articles/MDR.html index 19f0a37a0..6488f403e 100644 --- a/articles/MDR.html +++ b/articles/MDR.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/PCA.html b/articles/PCA.html index 1c2e6b976..c60a19f66 100644 --- a/articles/PCA.html +++ b/articles/PCA.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/WHONET.html b/articles/WHONET.html index 012a685e5..743d9655a 100644 --- a/articles/WHONET.html +++ b/articles/WHONET.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/datasets.html b/articles/datasets.html index 1c737829f..afd0fe3eb 100644 --- a/articles/datasets.html +++ b/articles/datasets.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/index.html b/articles/index.html index 3c2bdac48..cdf1b5aa5 100644 --- a/articles/index.html +++ b/articles/index.html @@ -1,5 +1,5 @@ -Articles • AMR (for R) +Articles • AMR (for R) Skip to contents diff --git a/articles/resistance_predict.html b/articles/resistance_predict.html index 0d63c0c64..22f23db24 100644 --- a/articles/resistance_predict.html +++ b/articles/resistance_predict.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/articles/welcome_to_AMR.html b/articles/welcome_to_AMR.html index c328bf7fc..601fe379b 100644 --- a/articles/welcome_to_AMR.html +++ b/articles/welcome_to_AMR.html @@ -20,6 +20,8 @@ + + Skip to contents diff --git a/authors.html b/authors.html index 21700536d..1f9a420a3 100644 --- a/authors.html +++ b/authors.html @@ -1,5 +1,5 @@ -Authors and Citation • AMR (for R) +Authors and Citation • AMR (for R) Skip to contents diff --git a/index.html b/index.html index c509ab83f..0840259e0 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,8 @@ + + Skip to contents diff --git a/news/index.html b/news/index.html index 3a504067d..aba8e5c1c 100644 --- a/news/index.html +++ b/news/index.html @@ -1,5 +1,5 @@ -Changelog • AMR (for R) +Changelog • AMR (for R) Skip to contents diff --git a/pkgdown.yml b/pkgdown.yml index 942e13eaf..d929fac2f 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -12,7 +12,7 @@ articles: resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html WHONET: WHONET.html -last_built: 2025-01-27T21:12Z +last_built: 2025-01-27T21:47Z urls: reference: https://msberends.github.io/AMR/reference article: https://msberends.github.io/AMR/articles diff --git a/reference/AMR-deprecated.html b/reference/AMR-deprecated.html index ad0fa2a0c..06e236762 100644 --- a/reference/AMR-deprecated.html +++ b/reference/AMR-deprecated.html @@ -1,5 +1,5 @@ -Deprecated Functions — AMR-deprecated • AMR (for R) +Deprecated Functions — AMR-deprecated • AMR (for R) Skip to contents diff --git a/reference/AMR-options.html b/reference/AMR-options.html index bcecf156b..a154aa9ff 100644 --- a/reference/AMR-options.html +++ b/reference/AMR-options.html @@ -1,5 +1,5 @@ -Options for the AMR package — AMR-options • AMR (for R) +Options for the AMR package — AMR-options • AMR (for R) Skip to contents diff --git a/reference/AMR.html b/reference/AMR.html index d69ad226d..3e440b50d 100644 --- a/reference/AMR.html +++ b/reference/AMR.html @@ -13,7 +13,7 @@ This work was published in the Journal of Statistical Software (Volume 104(3); d and doi:10.33612/diss.192486375 ). After installing this package, R knows ~79 000 microorganisms (updated June 2024) and all ~610 antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI and EUCAST are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the public University of Groningen, in collaboration with non-profit organisations Certe Medical Diagnostics and Advice Foundation and University Medical Center Groningen. -The AMR package is available in English, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Italian, Japanese, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Turkish, and Ukrainian. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages."> +The AMR package is available in English, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Italian, Japanese, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Turkish, and Ukrainian. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages."> Skip to contents diff --git a/reference/WHOCC.html b/reference/WHOCC.html index 909de1ecd..57be1b0cf 100644 --- a/reference/WHOCC.html +++ b/reference/WHOCC.html @@ -1,5 +1,5 @@ -WHOCC: WHO Collaborating Centre for Drug Statistics Methodology — WHOCC • AMR (for R) +WHOCC: WHO Collaborating Centre for Drug Statistics Methodology — WHOCC • AMR (for R) Skip to contents diff --git a/reference/WHONET.html b/reference/WHONET.html index 90cc0fec4..f9f0af2e9 100644 --- a/reference/WHONET.html +++ b/reference/WHONET.html @@ -1,5 +1,5 @@ -Data Set with 500 Isolates - WHONET Example — WHONET • AMR (for R) +Data Set with 500 Isolates - WHONET Example — WHONET • AMR (for R) Skip to contents diff --git a/reference/ab_from_text.html b/reference/ab_from_text.html index 3987c24ef..fb63bec8e 100644 --- a/reference/ab_from_text.html +++ b/reference/ab_from_text.html @@ -1,5 +1,5 @@ -Retrieve Antimicrobial Drug Names and Doses from Clinical Text — ab_from_text • AMR (for R) +Retrieve Antimicrobial Drug Names and Doses from Clinical Text — ab_from_text • AMR (for R) Skip to contents diff --git a/reference/ab_property.html b/reference/ab_property.html index 51f6aafd2..a0ba4d2ee 100644 --- a/reference/ab_property.html +++ b/reference/ab_property.html @@ -1,5 +1,5 @@ -Get Properties of an Antibiotic — ab_property • AMR (for R) +Get Properties of an Antibiotic — ab_property • AMR (for R) Skip to contents diff --git a/reference/add_custom_antimicrobials.html b/reference/add_custom_antimicrobials.html index afa4be77e..d2bae6bc4 100644 --- a/reference/add_custom_antimicrobials.html +++ b/reference/add_custom_antimicrobials.html @@ -1,5 +1,5 @@ -Add Custom Antimicrobials — add_custom_antimicrobials • AMR (for R) +Add Custom Antimicrobials — add_custom_antimicrobials • AMR (for R) Skip to contents diff --git a/reference/add_custom_microorganisms.html b/reference/add_custom_microorganisms.html index 8d326ccb2..b842720fb 100644 --- a/reference/add_custom_microorganisms.html +++ b/reference/add_custom_microorganisms.html @@ -1,5 +1,5 @@ -Add Custom Microorganisms — add_custom_microorganisms • AMR (for R) +Add Custom Microorganisms — add_custom_microorganisms • AMR (for R) Skip to contents diff --git a/reference/age.html b/reference/age.html index b82a36068..6a72ea36c 100644 --- a/reference/age.html +++ b/reference/age.html @@ -1,5 +1,5 @@ -Age in Years of Individuals — age • AMR (for R) +Age in Years of Individuals — age • AMR (for R) Skip to contents diff --git a/reference/age_groups.html b/reference/age_groups.html index 774ae4115..55cc3d32c 100644 --- a/reference/age_groups.html +++ b/reference/age_groups.html @@ -1,5 +1,5 @@ -Split Ages into Age Groups — age_groups • AMR (for R) +Split Ages into Age Groups — age_groups • AMR (for R) Skip to contents diff --git a/reference/antibiogram-1.png b/reference/antibiogram-1.png index 8af63aa20..08a1bec9b 100644 Binary files a/reference/antibiogram-1.png and b/reference/antibiogram-1.png differ diff --git a/reference/antibiogram-3.png b/reference/antibiogram-3.png index fac05d1b0..a8197dd8a 100644 Binary files a/reference/antibiogram-3.png and b/reference/antibiogram-3.png differ diff --git a/reference/antibiogram.html b/reference/antibiogram.html index 1adc9a470..6117d2159 100644 --- a/reference/antibiogram.html +++ b/reference/antibiogram.html @@ -1,7 +1,7 @@ Generate Traditional, Combination, Syndromic, or WISCA Antibiograms — antibiogram • AMR (for R) +Adhering to previously described approaches (see Source) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki et al., these functions provides flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports."> Skip to contents @@ -304,40 +304,27 @@ Adhering to previously described approaches (see Source) and especially the Baye

Why Use WISCA?

+

WISCA, as outlined by Barbieri et al. (doi:10.1186/s13756-021-00939-2 -), stands for -Weighted-Incidence Syndromic Combination Antibiogram, which estimates the probability -of adequate empirical antimicrobial regimen coverage for specific infection syndromes. -This method leverages a Bayesian hierarchical logistic regression framework with random -effects for pathogens and regimens, enabling robust estimates in the presence of sparse -data.

-

The Bayesian model assumes conjugate priors for parameter estimation. For example, the -coverage probability $theta$ for a given antimicrobial regimen -is modeled using a Beta distribution as a prior:

-

Beta prior

-

where \($alpha$_0\) and \($beta$_0\) represent prior successes and failures, respectively, -informed by expert knowledge or weakly informative priors (e.g., \($alpha$_0 = 1, $beta$_0 = 1\)).

-

The likelihood function is constructed based on observed data, where the number of covered -cases for a regimen follows a binomial distribution:

-

Binomial likelihood

-

Posterior parameter estimates are obtained by combining the prior and likelihood using -Bayes' theorem. The posterior distribution of \($theta$\) is also a Beta distribution:

-

Beta posterior

-

For hierarchical modeling, pathogen-level effects (e.g., differences in resistance -patterns) and regimen-level effects are modelled using Gaussian priors on log-odds. -This hierarchical structure ensures partial pooling of estimates across groups, -improving stability in strata with small sample sizes. The model is implemented using -Hamiltonian Monte Carlo (HMC) sampling.

-

Stratified results are provided based on covariates such as age, sex, and clinical -complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities). -For example, posterior odds ratios (ORs) are derived to quantify the effect of these -covariates on coverage probabilities:

-

Odds ratio formula

+), stands for Weighted-Incidence Syndromic Combination Antibiogram, which estimates the probability of adequate empirical antimicrobial regimen coverage for specific infection syndromes. This method leverages a Bayesian hierarchical logistic regression framework with random effects for pathogens and regimens, enabling robust estimates in the presence of sparse data.

+

The Bayesian model assumes conjugate priors for parameter estimation. For example, the coverage probability \(\theta\) for a given antimicrobial regimen is modelled using a Beta distribution as a prior:

+

$$\theta \sim \text{Beta}(\alpha_0, \beta_0)$$

+

where \(\alpha_0\) and \(\beta_0\) represent prior successes and failures, respectively, informed by expert knowledge or weakly informative priors (e.g., \(\alpha_0 = 1, \beta_0 = 1\)). The likelihood function is constructed based on observed data, where the number of covered cases for a regimen follows a binomial distribution:

+

$$y \sim \text{Binomial}(n, \theta)$$

+

Posterior parameter estimates are obtained by combining the prior and likelihood using Bayes' theorem. The posterior distribution of \(\theta\) is also a Beta distribution:

+

$$\theta | y \sim \text{Beta}(\alpha_0 + y, \beta_0 + n - y)$$

+

For hierarchical modelling, pathogen-level effects (e.g., differences in resistance patterns) and regimen-level effects are modelled using Gaussian priors on log-odds. This hierarchical structure ensures partial pooling of estimates across groups, improving stability in strata with small sample sizes. The model is implemented using Hamiltonian Monte Carlo (HMC) sampling.

+

Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using dplyr's group_by() as a pre-processing step before running wisca(). In this case, posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities:

+

$$\text{OR}_{\text{covariate}} = \frac{\exp(\beta_{\text{covariate}})}{\exp(\beta_0)}$$

By combining empirical data with prior knowledge, WISCA overcomes the limitations of traditional combination antibiograms, offering disease-specific, patient-stratified estimates with robust uncertainty quantification. This tool is invaluable for antimicrobial stewardship programs and empirical treatment guideline refinement.

+
+

Author

+

Implementation: Dr. Larisse Bolton and Dr. Matthijs Berends

+

Examples

@@ -537,7 +524,8 @@ stewardship programs and empirical treatment guideline refinement.

ureido <- antibiogram(example_isolates, antibiotics = ureidopenicillins(), - ab_transform = "name" + ab_transform = "name", + wisca = TRUE ) #> ℹ For ureidopenicillins() using column 'TZP' (piperacillin/tazobactam) @@ -550,10 +538,20 @@ stewardship programs and empirical treatment guideline refinement.

#> #> |Pathogen |Piperacillin/tazobactam | #> |:---------------|:-----------------------| -#> |CoNS |30% (10/33) | -#> |*E. coli* |94% (393/416) | -#> |*K. pneumoniae* |89% (47/53) | -#> |*S. pneumoniae* |100% (112/112) | +#> |*B. fragilis* |5% (0-17%,N=20) | +#> |CoNS |32% (17-47%,N=33) | +#> |*E. cloacae* |73% (51-88%,N=20) | +#> |*E. coli* |94% (92-96%,N=416) | +#> |*E. faecalis* |95% (82-100%,N=18) | +#> |*E. faecium* |10% (1-26%,N=18) | +#> |GBS |95% (84-100%,N=18) | +#> |*K. pneumoniae* |87% (78-95%,N=53) | +#> |*P. aeruginosa* |97% (88-100%,N=27) | +#> |*P. mirabilis* |97% (88-100%,N=27) | +#> |*S. anginosus* |94% (80-100%,N=16) | +#> |*S. marcescens* |50% (32-69%,N=22) | +#> |*S. pneumoniae* |99% (97-100%,N=112) | +#> |*S. pyogenes* |95% (81-100%,N=16) | # Generate plots with ggplot2 or base R -------------------------------- diff --git a/reference/antibiotics.html b/reference/antibiotics.html index 1b27852b1..56aba7d38 100644 --- a/reference/antibiotics.html +++ b/reference/antibiotics.html @@ -1,5 +1,5 @@ -Data Sets with 606 Antimicrobial Drugs — antibiotics • AMR (for R) +Data Sets with 606 Antimicrobial Drugs — antibiotics • AMR (for R) Skip to contents diff --git a/reference/antimicrobial_class_selectors.html b/reference/antimicrobial_class_selectors.html index 1d2b85482..42ec8d9f8 100644 --- a/reference/antimicrobial_class_selectors.html +++ b/reference/antimicrobial_class_selectors.html @@ -9,7 +9,7 @@ In short, if you have a column name that resembles an antimicrobial drug, it wil library(dplyr) my_data_with_all_these_columns %&gt;% select(cephalosporins()) -'> +'> Skip to contents diff --git a/reference/as.ab.html b/reference/as.ab.html index 8bd1d51a1..22ec0af1a 100644 --- a/reference/as.ab.html +++ b/reference/as.ab.html @@ -1,5 +1,5 @@ -Transform Input to an Antibiotic ID — as.ab • AMR (for R) +Transform Input to an Antibiotic ID — as.ab • AMR (for R) Skip to contents diff --git a/reference/as.av.html b/reference/as.av.html index deb989d39..68a73a332 100644 --- a/reference/as.av.html +++ b/reference/as.av.html @@ -1,5 +1,5 @@ -Transform Input to an Antiviral Drug ID — as.av • AMR (for R) +Transform Input to an Antiviral Drug ID — as.av • AMR (for R) Skip to contents diff --git a/reference/as.disk.html b/reference/as.disk.html index 6fd4e5aa4..32c477e5c 100644 --- a/reference/as.disk.html +++ b/reference/as.disk.html @@ -1,5 +1,5 @@ -Transform Input to Disk Diffusion Diameters — as.disk • AMR (for R) +Transform Input to Disk Diffusion Diameters — as.disk • AMR (for R) Skip to contents diff --git a/reference/as.mic.html b/reference/as.mic.html index fe4a5e8dd..a46b04f75 100644 --- a/reference/as.mic.html +++ b/reference/as.mic.html @@ -1,5 +1,5 @@ -Transform Input to Minimum Inhibitory Concentrations (MIC) — as.mic • AMR (for R) +Transform Input to Minimum Inhibitory Concentrations (MIC) — as.mic • AMR (for R) Skip to contents diff --git a/reference/as.mo.html b/reference/as.mo.html index 65bc60d2a..ad5926f32 100644 --- a/reference/as.mo.html +++ b/reference/as.mo.html @@ -1,5 +1,5 @@ -Transform Arbitrary Input to Valid Microbial Taxonomy — as.mo • AMR (for R) +Transform Arbitrary Input to Valid Microbial Taxonomy — as.mo • AMR (for R) Skip to contents @@ -222,7 +222,7 @@

With ambiguous user input in as.mo() and all the mo_* functions, the returned results are chosen based on their matching score using mo_matching_score(). This matching score \(m\), is calculated as:

-

mo matching score

+

$$m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \textrm{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}$$

where:

diff --git a/reference/ggplot_pca.html b/reference/ggplot_pca.html index 405c4aa23..247b86b89 100644 --- a/reference/ggplot_pca.html +++ b/reference/ggplot_pca.html @@ -1,5 +1,5 @@ -PCA Biplot with ggplot2 — ggplot_pca • AMR (for R) +PCA Biplot with ggplot2 — ggplot_pca • AMR (for R) Skip to contents diff --git a/reference/ggplot_sir.html b/reference/ggplot_sir.html index ee68bbc6e..924145abd 100644 --- a/reference/ggplot_sir.html +++ b/reference/ggplot_sir.html @@ -1,5 +1,5 @@ -AMR Plots with ggplot2 — ggplot_sir • AMR (for R) +AMR Plots with ggplot2 — ggplot_sir • AMR (for R) Skip to contents diff --git a/reference/guess_ab_col.html b/reference/guess_ab_col.html index 4cbf3a68d..7fc44ac36 100644 --- a/reference/guess_ab_col.html +++ b/reference/guess_ab_col.html @@ -1,5 +1,5 @@ -Guess Antibiotic Column — guess_ab_col • AMR (for R) +Guess Antibiotic Column — guess_ab_col • AMR (for R) Skip to contents diff --git a/reference/index.html b/reference/index.html index af02fa973..705daf3e7 100644 --- a/reference/index.html +++ b/reference/index.html @@ -1,5 +1,5 @@ -Package index • AMR (for R) +Package index • AMR (for R) Skip to contents diff --git a/reference/intrinsic_resistant.html b/reference/intrinsic_resistant.html index 9f52f483f..8dafa719a 100644 --- a/reference/intrinsic_resistant.html +++ b/reference/intrinsic_resistant.html @@ -1,5 +1,5 @@ -Data Set with Bacterial Intrinsic Resistance — intrinsic_resistant • AMR (for R) +Data Set with Bacterial Intrinsic Resistance — intrinsic_resistant • AMR (for R) Skip to contents diff --git a/reference/italicise_taxonomy.html b/reference/italicise_taxonomy.html index c8d385637..750c8668d 100644 --- a/reference/italicise_taxonomy.html +++ b/reference/italicise_taxonomy.html @@ -1,5 +1,5 @@ -Italicise Taxonomic Families, Genera, Species, Subspecies — italicise_taxonomy • AMR (for R) +Italicise Taxonomic Families, Genera, Species, Subspecies — italicise_taxonomy • AMR (for R) Skip to contents diff --git a/reference/join.html b/reference/join.html index 8977f1178..cdfa981bb 100644 --- a/reference/join.html +++ b/reference/join.html @@ -1,5 +1,5 @@ -Join microorganisms to a Data Set — join • AMR (for R) +Join microorganisms to a Data Set — join • AMR (for R) Skip to contents diff --git a/reference/key_antimicrobials.html b/reference/key_antimicrobials.html index 6df7bc017..ea6399500 100644 --- a/reference/key_antimicrobials.html +++ b/reference/key_antimicrobials.html @@ -1,5 +1,5 @@ -(Key) Antimicrobials for First Weighted Isolates — key_antimicrobials • AMR (for R) +(Key) Antimicrobials for First Weighted Isolates — key_antimicrobials • AMR (for R) Skip to contents diff --git a/reference/kurtosis.html b/reference/kurtosis.html index 6c5179d47..0dc306f03 100644 --- a/reference/kurtosis.html +++ b/reference/kurtosis.html @@ -1,5 +1,5 @@ -Kurtosis of the Sample — kurtosis • AMR (for R) +Kurtosis of the Sample — kurtosis • AMR (for R) Skip to contents @@ -90,9 +90,9 @@

Examples

kurtosis(rnorm(10000))
-#> [1] 2.883046
+#> [1] 3.0933
 kurtosis(rnorm(10000), excess = TRUE)
-#> [1] -0.05230069
+#> [1] 0.06364525