mirror of
https://github.com/msberends/AMR.git
synced 2025-12-15 09:10:25 +01:00
new EUCAST rules: clinical breakpoints
This commit is contained in:
@@ -2,8 +2,8 @@ context("portion.R")
|
||||
|
||||
test_that("portions works", {
|
||||
# amox resistance in `septic_patients`
|
||||
expect_equal(portion_R(septic_patients$amox), 0.662, tolerance = 0.0001)
|
||||
expect_equal(portion_I(septic_patients$amox), 0.003, tolerance = 0.0001)
|
||||
expect_equal(portion_R(septic_patients$amox), 0.5827645, tolerance = 0.0001)
|
||||
expect_equal(portion_I(septic_patients$amox), 0.0025597, tolerance = 0.0001)
|
||||
expect_equal(1 - portion_R(septic_patients$amox) - portion_I(septic_patients$amox),
|
||||
portion_S(septic_patients$amox))
|
||||
expect_equal(portion_R(septic_patients$amox) + portion_I(septic_patients$amox),
|
||||
@@ -12,17 +12,17 @@ test_that("portions works", {
|
||||
portion_SI(septic_patients$amox))
|
||||
|
||||
expect_equal(septic_patients %>% portion_S(amcl),
|
||||
0.6706853,
|
||||
0.7062363,
|
||||
tolerance = 0.001)
|
||||
expect_equal(septic_patients %>% portion_S(amcl, gent),
|
||||
0.9202373,
|
||||
0.9210074,
|
||||
tolerance = 0.001)
|
||||
|
||||
# amcl+genta susceptibility around 92.1%
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$amcl,
|
||||
septic_patients$gent,
|
||||
interpretation = "S")),
|
||||
0.9202373,
|
||||
0.9210074,
|
||||
tolerance = 0.000001)
|
||||
|
||||
# percentages
|
||||
@@ -57,7 +57,7 @@ test_that("portions works", {
|
||||
septic_patients$gent)))
|
||||
expect_equal(suppressWarnings(n_rsi(as.character(septic_patients$amcl,
|
||||
septic_patients$gent))),
|
||||
1576)
|
||||
1828)
|
||||
|
||||
# check for errors
|
||||
expect_error(portion_IR("test", minimum = "test"))
|
||||
@@ -83,16 +83,16 @@ test_that("portions works", {
|
||||
})
|
||||
|
||||
test_that("old rsi works", {
|
||||
# amox resistance in `septic_patients` should be around 66.33%
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$amox)), 0.665, tolerance = 0.0001)
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$amox, interpretation = "S")), 1 - 0.665, tolerance = 0.0001)
|
||||
# amox resistance in `septic_patients` should be around 58.53%
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$amox)), 0.5853, tolerance = 0.0001)
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$amox, interpretation = "S")), 1 - 0.5853, tolerance = 0.0001)
|
||||
|
||||
# pita+genta susceptibility around 98.09%
|
||||
expect_equal(suppressWarnings(rsi(septic_patients$pita,
|
||||
septic_patients$gent,
|
||||
interpretation = "S",
|
||||
info = TRUE)),
|
||||
0.9540412,
|
||||
0.9498886,
|
||||
tolerance = 0.0001)
|
||||
|
||||
# count of cases
|
||||
|
||||
Reference in New Issue
Block a user