diff --git a/articles/AMR.html b/articles/AMR.html index 9da4d567..57962d2c 100644 --- a/articles/AMR.html +++ b/articles/AMR.html @@ -162,7 +162,7 @@

How to conduct AMR data analysis

Dr. Matthijs Berends

-

20 October 2022

+

21 October 2022

Source: vignettes/AMR.Rmd
AMR.Rmd
@@ -170,7 +170,7 @@ -

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 20 October 2022.

+

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 21 October 2022.

Introduction

@@ -201,21 +201,21 @@ -2022-10-20 +2022-10-21 abcd Escherichia coli S S -2022-10-20 +2022-10-21 abcd Escherichia coli S R -2022-10-20 +2022-10-21 efgh Escherichia coli R @@ -325,67 +325,67 @@ -2010-07-04 -N1 +2014-10-24 +Z2 Hospital D Escherichia coli -S -S -S -S -M - - -2014-02-09 -T10 -Hospital C -Streptococcus pneumoniae -S -I -S -S -F - - -2017-03-28 -P6 -Hospital B -Escherichia coli -S R S S +S F -2016-05-18 -E5 +2013-05-29 +G1 Hospital A -Streptococcus pneumoniae -S +Escherichia coli +R S S S M -2016-10-13 -F4 -Hospital D +2012-08-07 +U2 +Hospital A Escherichia coli S +S +S +S +F + + +2012-05-20 +V3 +Hospital D +Staphylococcus aureus +S +S R S +F + + +2014-06-18 +M1 +Hospital D +Klebsiella pneumoniae +R +S +S S M -2013-09-14 -Y9 -Hospital D -Streptococcus pneumoniae -S +2016-02-29 +V8 +Hospital B +Staphylococcus aureus S +R S S F @@ -422,16 +422,16 @@ Longest: 1

1 M -10,377 -51.89% -10,377 -51.89% +10,349 +51.75% +10,349 +51.75% 2 F -9,623 -48.12% +9,651 +48.26% 20,000 100.00% @@ -488,9 +488,9 @@ Longest: 1

# Basing inclusion on all antimicrobial results, using a points threshold of # 2 # Including isolates from ICU. -# => Found 10,663 'phenotype-based' first isolates (53.3% of total where a +# => Found 10,623 'phenotype-based' first isolates (53.1% of total where a # microbial ID was available)
-

So only 53.3% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

+

So only 53.1% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

 data_1st <- data %>%
   filter(first == TRUE)
@@ -499,7 +499,7 @@ Longest: 1

data_1st <- data %>% filter_first_isolate() # Including isolates from ICU. -

So we end up with 10,663 isolates for analysis. Now our data looks like:

+

So we end up with 10,623 isolates for analysis. Now our data looks like:

 head(data_1st)
@@ -538,28 +538,28 @@ Longest: 1

- - - - - - - + + + + - - - - + + + + + + + - - - + + + - - + + @@ -569,64 +569,64 @@ Longest: 1

- - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -653,8 +653,8 @@ Longest: 1

data_1st %>% freq(genus, species)

Frequency table

Class: character
-Length: 10,663
-Available: 10,663 (100.0%, NA: 0 = 0.0%)
+Length: 10,623
+Available: 10,623 (100.0%, NA: 0 = 0.0%)
Unique: 4

Shortest: 16
Longest: 24

@@ -671,33 +671,33 @@ Longest: 24

- - - - + + + + - - - - + + + + - - - - + + + + - - - + + + @@ -716,14 +716,14 @@ Longest: 24

-+-+ @@ -744,95 +744,95 @@ Longest: 24

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - + + + + - - + + - - + + - + - - + + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22014-02-09T10Hospital CB_STRPT_PNMNSSS2013-05-29G1Hospital AB_ESCHR_COLI RFGram-positiveStreptococcuspneumoniaeSSSMGram-negativeEscherichiacoli TRUE
32017-03-28P6Hospital B2012-08-07U2Hospital A B_ESCHR_COLIRRSS S S F TRUE
52016-10-13F442012-05-20V3 Hospital DB_ESCHR_COLIRRSSMGram-negativeEscherichiacoliTRUE
62013-09-14Y9Hospital DB_STRPT_PNMNSSSRFGram-positiveStreptococcuspneumoniaeTRUE
72016-09-03A7Hospital B B_STPHY_AURS S SR SSMF Gram-positive Staphylococcus aureus TRUE
112012-12-21O1Hospital A52014-06-18M1Hospital DB_KLBSL_PNMNRSSSMGram-negativeKlebsiellapneumoniaeTRUE
62016-02-29V8Hospital BB_STPHY_AURSRRSSFGram-positiveStaphylococcusaureusTRUE
72010-05-10B9Hospital D B_STRPT_PNMN S S S RFM Gram-positive Streptococcus pneumoniae
1 Escherichia coli4,61243.25%4,61243.25%4,63043.58%4,63043.58%
2 Staphylococcus aureus2,73225.62%7,34468.87%2,71025.51%7,34069.10%
3 Streptococcus pneumoniae2,15120.17%9,49589.05%2,05719.36%9,39788.46%
4 Klebsiella pneumoniae1,16810.95%10,6631,22611.54%10,623 100.00%
2014-02-09T102010-05-10B9Hospital DB_STRPT_PNMNSSSRMGram-positiveStreptococcuspneumoniaeTRUE
2017-02-28B6Hospital DB_STRPT_PNMNSSSRMGram-positiveStreptococcuspneumoniaeTRUE
2016-03-07L6 Hospital CB_STRPT_PNMNSB_ESCHR_COLIR S S RFGram-positiveStreptococcuspneumoniaeMGram-negativeEscherichiacoli TRUE
2013-09-14Y92011-02-04J2 Hospital D B_STRPT_PNMNSSRR S RFM Gram-positive Streptococcus pneumoniae TRUE
2012-12-21O12015-07-22X8 Hospital AB_STRPT_PNMNB_STPHY_AURS S S S R F Gram-positiveStaphylococcusaureusTRUE
2017-03-20P7Hospital DB_STRPT_PNMNRRRRFGram-positive Streptococcus pneumoniae TRUE
2011-07-03S2Hospital BB_ESCHR_COLISSSRFGram-negativeEscherichiacoliTRUE
2010-04-27Y1Hospital AB_ESCHR_COLISSSRFGram-negativeEscherichiacoliTRUE
2017-06-16V4Hospital DB_ESCHR_COLIRSSRFGram-negativeEscherichiacoliTRUE

If you want to get a quick glance of the number of isolates in different bug/drug combinations, you can use the bug_drug_combinations() function:

@@ -854,50 +854,50 @@ Longest: 24

E. coli AMX -2181 -134 -2297 -4612 +2159 +145 +2326 +4630 E. coli AMC -3388 -167 -1057 -4612 +3398 +178 +1054 +4630 E. coli CIP -3355 +3369 0 -1257 -4612 +1261 +4630 E. coli GEN -4036 +4053 0 -576 -4612 +577 +4630 K. pneumoniae AMX 0 0 -1168 -1168 +1226 +1226 K. pneumoniae AMC -912 -43 -213 -1168 +943 +48 +235 +1226 @@ -920,34 +920,34 @@ Longest: 24

E. coli GEN -4036 +4053 0 -576 -4612 +577 +4630 K. pneumoniae GEN -1042 +1092 0 -126 -1168 +134 +1226 S. aureus GEN -2433 +2400 0 -299 -2732 +310 +2710 S. pneumoniae GEN 0 0 -2151 -2151 +2057 +2057 @@ -961,7 +961,7 @@ Longest: 24

As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R(), equal to resistance()) and susceptibility as the proportion of S and I (proportion_SI(), equal to susceptibility()). These functions can be used on their own:

 data_1st %>% resistance(AMX)
-# [1] 0.5430929
+# [1] 0.5488092

Or can be used in conjunction with group_by() and summarise(), both from the dplyr package:

 data_1st %>%
@@ -975,19 +975,19 @@ Longest: 24

Hospital A -0.5517885 +0.5565721 Hospital B -0.5364807 +0.5457235 Hospital C -0.5249089 +0.5533546 Hospital D -0.5559306 +0.5385735 @@ -1008,23 +1008,23 @@ Longest: 24

Hospital A -0.5517885 -3215 +0.5565721 +3279 Hospital B -0.5364807 -3728 +0.5457235 +3718 Hospital C -0.5249089 -1646 +0.5533546 +1565 Hospital D -0.5559306 -2074 +0.5385735 +2061 @@ -1047,27 +1047,27 @@ Longest: 24

Escherichia -0.7708153 -0.8751084 -0.9754987 +0.7723542 +0.8753780 +0.9790497 Klebsiella -0.8176370 -0.8921233 -0.9803082 +0.8083197 +0.8907015 +0.9787928 Staphylococcus -0.7877013 -0.8905564 -0.9802343 +0.7911439 +0.8856089 +0.9833948 Streptococcus -0.5281265 +0.5333009 0.0000000 -0.5281265 +0.5333009 @@ -1092,23 +1092,23 @@ Longest: 24

Hospital A -55.2% +55.7% 28.5% Hospital B -53.6% -25.4% +54.6% +25.6% Hospital C -52.5% -26.3% +55.3% +26.5% Hospital D -55.6% -27.4% +53.9% +24.8% @@ -1206,18 +1206,16 @@ Longest: 24

mic_values <- random_mic(size = 100) mic_values # Class 'mic' -# [1] 32 0.025 4 0.01 32 <=0.001 0.0625 0.002 0.125 -# [10] 4 64 64 0.01 0.005 64 0.125 8 1 -# [19] 0.25 0.002 0.01 16 0.01 256 32 2 0.005 -# [28] 8 0.002 0.125 0.025 0.005 1 0.025 4 0.005 -# [37] 4 <=0.001 64 32 0.025 0.125 1 64 0.002 -# [46] 0.005 0.5 0.005 0.0625 0.5 0.125 1 0.25 0.025 -# [55] 1 0.005 0.002 0.0625 2 32 0.01 0.0625 16 -# [64] 0.005 0.125 0.01 4 0.5 4 2 0.01 0.25 -# [73] 16 <=0.001 0.0625 0.0625 64 16 0.0625 0.25 0.01 -# [82] 256 128 64 16 0.25 8 64 0.002 <=0.001 -# [91] 256 <=0.001 32 0.5 16 <=0.001 0.5 16 0.5 -# [100] 16
+# [1] 8 64 4 0.005 32 0.125 0.005 4 >=256 0.005 +# [11] 0.01 >=256 0.01 0.5 8 0.125 0.01 4 0.125 0.5 +# [21] 1 1 0.25 0.0625 8 128 8 64 >=256 0.5 +# [31] 0.25 8 2 32 0.125 0.0625 0.25 0.025 0.001 8 +# [41] 128 2 64 0.25 >=256 0.01 0.01 2 0.125 0.025 +# [51] >=256 0.25 0.025 8 0.005 0.125 0.025 16 0.01 0.025 +# [61] 1 64 8 1 64 0.025 32 >=256 8 2 +# [71] 4 0.25 0.002 0.001 1 0.001 >=256 16 4 2 +# [81] 0.125 0.125 0.125 4 64 2 0.01 0.01 0.01 4 +# [91] 16 32 0.005 0.005 4 0.0625 0.125 0.005 0.01 2
 # base R:
 plot(mic_values)
@@ -1244,10 +1242,10 @@ Longest: 24

disk_values <- random_disk(size = 100, mo = "E. coli", ab = "cipro") disk_values # Class 'disk' -# [1] 28 27 22 29 26 26 28 22 31 20 23 18 26 31 28 18 17 19 17 23 19 21 27 28 24 -# [26] 30 27 22 21 24 28 28 24 18 31 31 17 17 30 30 17 30 26 27 21 17 28 20 21 27 -# [51] 31 28 23 24 30 19 27 30 24 29 23 26 22 24 17 17 31 20 27 20 22 29 27 28 30 -# [76] 20 31 25 29 20 29 27 28 29 20 30 27 21 23 24 24 26 18 26 27 19 25 26 28 24 +# [1] 22 18 29 23 26 26 22 22 17 28 29 31 25 28 22 27 28 30 27 26 28 29 31 19 26 +# [26] 25 25 24 25 30 17 21 25 21 18 17 30 23 30 19 18 29 25 29 27 23 28 21 17 25 +# [51] 27 23 17 29 28 25 30 23 21 22 20 21 28 25 23 31 29 25 31 17 22 20 21 17 19 +# [76] 17 21 21 18 18 20 29 30 21 18 23 18 29 25 22 27 22 22 24 24 25 27 31 26 18
 # base R:
 plot(disk_values, mo = "E. coli", ab = "cipro")
diff --git a/articles/AMR_files/figure-html/disk_plots-1.png b/articles/AMR_files/figure-html/disk_plots-1.png index 76ca3e3f..15e05fc9 100644 Binary files a/articles/AMR_files/figure-html/disk_plots-1.png and b/articles/AMR_files/figure-html/disk_plots-1.png differ diff --git a/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png b/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png index bd5d2660..0e1739c2 100644 Binary files a/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png and b/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png differ diff --git a/articles/AMR_files/figure-html/mic_plots-1.png b/articles/AMR_files/figure-html/mic_plots-1.png index e0b07c43..7f01acc2 100644 Binary files a/articles/AMR_files/figure-html/mic_plots-1.png and b/articles/AMR_files/figure-html/mic_plots-1.png differ diff --git a/articles/AMR_files/figure-html/mic_plots-2.png b/articles/AMR_files/figure-html/mic_plots-2.png index 5e387d22..ca0fc86b 100644 Binary files a/articles/AMR_files/figure-html/mic_plots-2.png and b/articles/AMR_files/figure-html/mic_plots-2.png differ diff --git a/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png b/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png index 84065bfe..3ca09aca 100644 Binary files a/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png and b/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png differ diff --git a/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png b/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png index a2340a7f..6528e570 100644 Binary files a/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png and b/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png differ diff --git a/articles/AMR_files/figure-html/plot 1-1.png b/articles/AMR_files/figure-html/plot 1-1.png index f49bea70..6bd853d1 100644 Binary files a/articles/AMR_files/figure-html/plot 1-1.png and b/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/articles/AMR_files/figure-html/plot 3-1.png b/articles/AMR_files/figure-html/plot 3-1.png index da13157e..c55f0faf 100644 Binary files a/articles/AMR_files/figure-html/plot 3-1.png and b/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/articles/AMR_files/figure-html/plot 4-1.png b/articles/AMR_files/figure-html/plot 4-1.png index c37e11ed..c8460676 100644 Binary files a/articles/AMR_files/figure-html/plot 4-1.png and b/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/articles/AMR_files/figure-html/plot 5-1.png b/articles/AMR_files/figure-html/plot 5-1.png index af8908d4..11d0f046 100644 Binary files a/articles/AMR_files/figure-html/plot 5-1.png and b/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/articles/MDR.html b/articles/MDR.html index e5efeed7..49f251a2 100644 --- a/articles/MDR.html +++ b/articles/MDR.html @@ -314,19 +314,19 @@ Unique: 2

 head(my_TB_data)
 #   rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1          S         I            I          S            I            S
-# 2          R         I            I          R            R            R
-# 3          S         I            S          S            S            R
-# 4          R         S            R          I            R            S
-# 5          I         R            I          I            R            I
-# 6          S         I            I          S            I            S
+# 1          S         R            R          I            R            I
+# 2          R         I            I          R            I            R
+# 3          I         S            I          S            I            S
+# 4          I         I            I          R            I            I
+# 5          S         S            R          S            R            I
+# 6          I         S            R          R            I            R
 #   kanamycin
 # 1         R
 # 2         I
-# 3         R
-# 4         I
-# 5         I
-# 6         S
+# 3 I +# 4 R +# 5 S +# 6 I

We can now add the interpretation of MDR-TB to our data set. You can use:

 mdro(my_TB_data, guideline = "TB")
@@ -357,40 +357,40 @@ Unique: 5

1 Mono-resistant -3202 -64.04% -3202 -64.04% +3234 +64.68% +3234 +64.68% 2 Negative -995 -19.90% -4197 -83.94% +984 +19.68% +4218 +84.36% 3 Multi-drug-resistant -443 -8.86% -4640 -92.80% +447 +8.94% +4665 +93.30% 4 Poly-resistant -260 -5.20% -4900 -98.00% +236 +4.72% +4901 +98.02% 5 Extensively drug-resistant -100 -2.00% +99 +1.98% 5000 100.00% diff --git a/articles/SPSS.html b/articles/SPSS.html index ae8546d5..a8d95ffd 100644 --- a/articles/SPSS.html +++ b/articles/SPSS.html @@ -162,7 +162,7 @@

How to import data from SPSS / SAS / Stata

Dr. Matthijs Berends

-

20 October 2022

+

21 October 2022

Source: vignettes/SPSS.Rmd
SPSS.Rmd
diff --git a/articles/datasets.html b/articles/datasets.html index f8dc4e4d..58fc832e 100644 --- a/articles/datasets.html +++ b/articles/datasets.html @@ -161,7 +161,7 @@