diff --git a/articles/AMR.html b/articles/AMR.html index 053cd287..041d02a5 100644 --- a/articles/AMR.html +++ b/articles/AMR.html @@ -168,7 +168,7 @@

Dr. Matthijs Berends

-

28 November 2022

+

29 November 2022

Source: vignettes/AMR.Rmd
AMR.Rmd
@@ -180,7 +180,7 @@ Berends 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 28 November 2022.

+generated on 29 November 2022.

Introduction

@@ -236,21 +236,21 @@ make the structure of your data generally look like this:

-2022-11-28 +2022-11-29 abcd Escherichia coli S S -2022-11-28 +2022-11-29 abcd Escherichia coli S R -2022-11-28 +2022-11-29 efgh Escherichia coli R @@ -400,71 +400,71 @@ data set:

-2016-12-09 -B5 +2016-02-08 +L4 Hospital A -Klebsiella pneumoniae -I -S +Escherichia coli R +R +S S M -2013-12-22 -V7 +2011-06-04 +B4 Hospital B Escherichia coli +R +S +S +S +M + + +2010-12-27 +U10 +Hospital B +Klebsiella pneumoniae S S S S F + +2013-08-11 +H1 +Hospital C +Staphylococcus aureus +R +S +S +S +M + -2011-09-01 -J7 +2011-08-27 +M9 Hospital B Streptococcus pneumoniae +S +S +S +S +M + + +2015-04-24 +L8 +Hospital C +Streptococcus pneumoniae R S S S M - -2010-09-10 -N5 -Hospital A -Escherichia coli -S -S -S -S -M - - -2015-12-02 -E9 -Hospital B -Staphylococcus aureus -S -S -R -S -M - - -2012-01-20 -V9 -Hospital B -Staphylococcus aureus -S -R -S -S -F -

Now, let’s start the cleaning and the analysis!

@@ -499,16 +499,16 @@ Longest: 1

1 M -10,502 -52.51% -10,502 -52.51% +10,441 +52.21% +10,441 +52.21% 2 F -9,498 -47.49% +9,559 +47.80% 20,000 100.00% @@ -621,9 +621,9 @@ takes into account the antimicrobial susceptibility test results using # Basing inclusion on all antimicrobial results, using a points threshold of # 2 # Including isolates from ICU. -# => Found 10,638 'phenotype-based' first isolates (53.2% of total where a +# => Found 10,709 'phenotype-based' first isolates (53.5% of total where a # microbial ID was available)
-

So only 53.2% is suitable for resistance analysis! We can now filter +

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

@@ -634,12 +634,13 @@ on it with the data_1st <- data %>%
   filter_first_isolate()
 # Including isolates from ICU.
-

So we end up with 10,638 isolates for analysis. Now our data looks +

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

 head(data_1st)
- +
+@@ -655,6 +656,7 @@ like:

+ @@ -671,90 +673,96 @@ like:

- - - + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -793,8 +801,8 @@ readable:

data_1st %>% freq(genus, species)

Frequency table

Class: character
-Length: 10,638
-Available: 10,638 (100%, NA: 0 = 0%)
+Length: 10,709
+Available: 10,709 (100%, NA: 0 = 0%)
Unique: 4

Shortest: 16
Longest: 24

@@ -819,33 +827,33 @@ Longest: 24

- - - - + + + + - - - - + + + + - - - - + + + + - - - + + + @@ -894,8 +902,38 @@ antibiotic class they are in:

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -909,54 +947,24 @@ antibiotic class they are in:

- - + + - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + + + @@ -969,9 +977,9 @@ antibiotic class they are in:

- - - + + + @@ -1005,50 +1013,50 @@ different bug/drug combinations, you can use the - - - - + + + + - - - - + + + + - + - - + + - + - - + + - - + + - - - - + + + +
date patient_id hospital
2016-12-09B5Hospital A32010-12-27U10Hospital B B_KLBSL_PNMN R SR SMSF Gram-negative Klebsiella pneumoniae TRUE
2013-12-22V7Hospital BB_ESCHR_COLISSSSFGram-negativeEscherichiacoliTRUE
2011-09-01J7Hospital BB_STRPT_PNMNRRSRMGram-positiveStreptococcuspneumoniaeTRUE
2010-09-10N5Hospital AB_ESCHR_COLISSSSMGram-negativeEscherichiacoliTRUE
2015-12-02E9Hospital B42013-08-11H1Hospital C B_STPHY_AURSSS R SSS M Gram-positive Staphylococcus aureus TRUE
72013-10-25I3Hospital AB_ESCHR_COLIRSRSMGram-negativeEscherichiacoliTRUE
2012-01-20V9Hospital BB_STPHY_AURSR92011-08-23Y10Hospital AB_ESCHR_COLI R S SS FGram-negativeEscherichiacoliTRUE
112012-08-03U10Hospital AB_KLBSL_PNMNRSSSFGram-negativeKlebsiellapneumoniaeTRUE
122013-12-31L3Hospital AB_STPHY_AURSRSSSM Gram-positive Staphylococcus aureus
1 Escherichia coli4,64643.67%4,64643.67%4,63543.28%4,63543.28%
2 Staphylococcus aureus2,74325.78%7,38969.46%2,75725.74%7,39269.03%
3 Streptococcus pneumoniae2,06519.41%9,45488.87%2,11519.75%9,50788.78%
4 Klebsiella pneumoniae1,18411.13%10,6381,20211.22%10,709 100.00%
2011-09-01J72014-06-23T5Hospital BB_STRPT_PNMNSSSRFGram-positiveStreptococcuspneumoniaeTRUE
2016-09-29N9Hospital AB_ESCHR_COLISSSRFGram-negativeEscherichiacoliTRUE
2011-01-04E8 Hospital B B_STRPT_PNMN R TRUE
2014-11-04C72017-12-28Z5 Hospital C B_STRPT_PNMNRR SRMGram-positiveStreptococcuspneumoniaeTRUE
2010-05-22X1Hospital CB_ESCHR_COLIRIS S R FGram-negativeEscherichiacoliTRUE
2011-03-20A1Hospital CB_STRPT_PNMNRRSRM Gram-positive Streptococcus pneumoniae TRUE
2016-05-13K9Hospital A2010-08-11C6Hospital C B_STRPT_PNMN S S TRUE
2014-01-21Q10Hospital D2012-08-24Z9Hospital A B_STRPT_PNMN S S
E. coli AMX217114723284646220412123104635
E. coli AMC342915710604646338915010964635
E. coli CIP33543408 01292464612274635
E. coli GEN40834065 056346465704635
K. pneumoniae AMX 0 01184118412021202
K. pneumoniae AMC936422061184927502251202
@@ -1070,34 +1078,34 @@ different bug/drug combinations, you can use the E. coli GEN -4083 +4065 0 -563 -4646 +570 +4635 K. pneumoniae GEN -1073 +1095 0 -111 -1184 +107 +1202 S. aureus GEN -2435 +2408 0 -308 -2743 +349 +2757 S. pneumoniae GEN 0 0 -2065 -2065 +2115 +2115 @@ -1129,7 +1137,7 @@ I (proportion_SI(), equa own:

 data_1st %>% resistance(AMX)
-# [1] 0.5455913
+# [1] 0.5429078

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

@@ -1144,19 +1152,19 @@ own:

Hospital A -0.5382918 +0.5461974 Hospital B -0.5347408 +0.5343758 Hospital C -0.5776965 +0.5487149 Hospital D -0.5509126 +0.5482517 @@ -1181,23 +1189,23 @@ all isolates available for every group (i.e. values S, I or R):

Hospital A -0.5382918 -3173 +0.5461974 +3182 Hospital B -0.5347408 -3742 +0.5343758 +3709 Hospital C -0.5776965 -1641 +0.5487149 +1673 Hospital D -0.5509126 -2082 +0.5482517 +2145 @@ -1222,27 +1230,27 @@ therapies very easily:

Escherichia -0.7718467 -0.8788205 -0.9750323 +0.7635383 +0.8770227 +0.9766990 Klebsiella -0.8260135 -0.9062500 -0.9873311 +0.8128120 +0.9109817 +0.9833611 Staphylococcus -0.7907401 -0.8877142 -0.9817718 +0.7972434 +0.8734131 +0.9818643 Streptococcus -0.5438257 +0.5399527 0.0000000 -0.5438257 +0.5399527 @@ -1270,23 +1278,23 @@ classes, use a antibiotic class selector such as Hospital A -53.8% -25.3% +54.6% +27.7% Hospital B -53.5% -25.1% +53.4% +26.4% Hospital C -57.8% -30.1% +54.9% +25.2% Hospital D -55.1% -26.3% +54.8% +26.7% @@ -1402,18 +1410,16 @@ classes) <mic> and <disk>:

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

disk_values <- random_disk(size = 100, mo = "E. coli", ab = "cipro") disk_values # Class 'disk' -# [1] 31 26 24 18 17 18 27 18 28 19 17 23 30 18 22 25 28 27 19 21 27 31 27 20 31 -# [26] 20 18 24 17 17 30 18 24 25 29 29 17 25 18 18 17 31 20 29 30 18 24 29 23 27 -# [51] 17 19 29 17 29 24 22 17 19 19 28 25 25 25 31 30 30 23 28 29 27 20 18 31 28 -# [76] 24 30 22 27 20 20 28 23 31 25 19 30 20 19 19 21 28 27 19 31 21 28 30 17 18 +# [1] 31 26 18 31 23 20 17 17 28 29 27 20 23 19 19 24 23 29 20 17 24 26 31 21 20 +# [26] 26 19 20 18 31 18 17 31 19 26 20 19 27 20 22 17 25 24 29 19 24 28 25 20 22 +# [51] 30 23 18 28 29 22 18 23 30 18 18 22 24 29 26 23 31 31 21 20 31 21 26 23 25 +# [76] 23 26 25 29 22 26 18 23 29 26 31 25 17 30 23 21 28 31 26 30 29 29 25 28 27
 # 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 54ce3b46..46cb8eba 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 16d01372..6f34e343 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 026a7251..b7f2754c 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 b78d693b..d11db95f 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 a8827bb5..7091dbbb 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 939a6329..01c32ee7 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 9b602acb..48cb46e4 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 47b99ae4..160f3f90 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 e57b7a79..2867b2d8 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 e110c030..3b0d6b35 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 6a5e373d..ab6fc874 100644 --- a/articles/MDR.html +++ b/articles/MDR.html @@ -375,17 +375,17 @@ names or codes, this would have worked exactly the same way:

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

We can now add the interpretation of MDR-TB to our data set. You can @@ -428,40 +428,40 @@ Unique: 5

1 Mono-resistant -3140 -62.80% -3140 -62.80% +3210 +64.20% +3210 +64.20% 2 Negative -1047 -20.94% -4187 -83.74% +1010 +20.20% +4220 +84.40% 3 Multi-drug-resistant -456 -9.12% -4643 -92.86% +451 +9.02% +4671 +93.42% 4 Poly-resistant -254 -5.08% -4897 -97.94% +235 +4.70% +4906 +98.12% 5 Extensively drug-resistant -103 -2.06% +94 +1.88% 5000 100.00% diff --git a/articles/SPSS.html b/articles/SPSS.html index 1a3ca592..5a5179aa 100644 --- a/articles/SPSS.html +++ b/articles/SPSS.html @@ -168,7 +168,7 @@

Dr. Matthijs Berends

-

28 November 2022

+

29 November 2022

Source: vignettes/SPSS.Rmd
SPSS.Rmd
diff --git a/articles/datasets.html b/articles/datasets.html index a986ae70..f005163b 100644 --- a/articles/datasets.html +++ b/articles/datasets.html @@ -166,7 +166,7 @@