mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 05:22:48 +02:00
(v1.1.0.9019) mo_source fix
This commit is contained in:
@ -477,8 +477,7 @@ The next example uses the `example_isolates` data set. This is a data set includ
|
||||
We will compare the resistance to fosfomycin (column `FOS`) in hospital A and D. The input for the `fisher.test()` can be retrieved with a transformation like this:
|
||||
|
||||
```{r, results = 'markup'}
|
||||
# use package 'tidyr' to pivot data;
|
||||
# it gets installed with this 'AMR' package
|
||||
# use package 'tidyr' to pivot data:
|
||||
library(tidyr)
|
||||
|
||||
check_FOS <- example_isolates %>%
|
||||
@ -501,4 +500,4 @@ We can apply the test now with:
|
||||
fisher.test(check_FOS)
|
||||
```
|
||||
|
||||
As can be seen, the p value is `r round(fisher.test(check_FOS)$p.value, 3)`, which means that the fosfomycin resistance found in hospital A and D are really different.
|
||||
As can be seen, the p value is `r round(fisher.test(check_FOS)$p.value, 3)`, which means that the fosfomycin resistance found in isolates from patients in hospital A and D are really different.
|
||||
|
@ -65,7 +65,6 @@ example_isolates %>%
|
||||
freq() # show frequency table of the result
|
||||
```
|
||||
```{r, echo = FALSE, results = 'asis', message = FALSE, warning = FALSE}
|
||||
library(dplyr)
|
||||
example_isolates %>%
|
||||
mdro(info = FALSE) %>%
|
||||
freq() # show frequency table of the result
|
||||
|
@ -86,7 +86,6 @@ ggplot_pca(pca_result)
|
||||
You can also print an ellipse per group, and edit the appearance:
|
||||
|
||||
```{r}
|
||||
|
||||
ggplot_pca(pca_result, ellipse = TRUE) +
|
||||
ggplot2::labs(title = "An AMR/PCA biplot!")
|
||||
```
|
||||
|
@ -122,9 +122,6 @@ Uncommon microorganisms take some more time than common microorganisms. To furth
|
||||
|
||||
Repetitive results are unique values that are present more than once. Unique values will only be calculated once by `as.mo()`. We will use `mo_name()` for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses `as.mo()` internally.
|
||||
|
||||
```{r, message = FALSE, eval = FALSE}
|
||||
library(dplyr)
|
||||
```
|
||||
```{r, message = FALSE}
|
||||
# take all MO codes from the example_isolates data set
|
||||
x <- example_isolates$mo %>%
|
||||
|
@ -89,7 +89,7 @@ ggplot_rsi_predict(predict_TZP, ribbon = FALSE)
|
||||
|
||||
### Choosing the right model
|
||||
|
||||
Resistance is not easily predicted; if we look at vancomycin resistance in Gram positives, the spread (i.e. standard error) is enormous:
|
||||
Resistance is not easily predicted; if we look at vancomycin resistance in Gram-positive bacteria, the spread (i.e. standard error) is enormous:
|
||||
|
||||
```{r}
|
||||
example_isolates %>%
|
||||
@ -110,7 +110,7 @@ Valid values are:
|
||||
| `"loglin"` or `"poisson"` | `glm(..., family = poisson)` | Generalised linear model with poisson distribution |
|
||||
| `"lin"` or `"linear"` | `lm()` | Linear model |
|
||||
|
||||
For the vancomycin resistance in Gram positive bacteria, a linear model might be more appropriate since no (left half of a) binomial distribution is to be expected based on the observed years:
|
||||
For the vancomycin resistance in Gram-positive bacteria, a linear model might be more appropriate since no binomial distribution is to be expected based on the observed years:
|
||||
|
||||
```{r}
|
||||
example_isolates %>%
|
||||
|
Reference in New Issue
Block a user