Skip to content

Commit

Permalink
tests: added tests for paired delong confidence interval.
Browse files Browse the repository at this point in the history
  • Loading branch information
wzbillings committed Jul 19, 2021
1 parent ebf313e commit 4cb8634
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-roc.test.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,30 @@ test_that("roc.test works", {
test_that("roc.test statistic and p are as expected with defaults", {
expect_equal(t1$statistic, c(Z=2.20898359144091))
expect_equal(t1$p.value, 0.0271757822291882)
expect_equal(t1$conf.int[[1]], 0.0104061769564846)
expect_equal(t1$conf.int[[2]], 0.174214419249478)
expect_match(t1$method, "DeLong")
expect_match(t1$method, "correlated")
expect_identical(t1$alternative, "two.sided")
expect_identical(attr(t1$conf.int, "conf.level"), 0.95)

expect_equal(t2$statistic, c(Z=2.79777591868904))
expect_equal(t2$p.value, 0.00514557970691098)
expect_equal(t2$conf.int[[1]], 0.0634011709339876)
expect_equal(t2$conf.int[[2]], 0.3600405634833566)
expect_match(t2$method, "DeLong")
expect_match(t2$method, "correlated")
expect_identical(t2$alternative, "two.sided")
expect_identical(attr(t2$conf.int, "conf.level"), 0.95)

expect_equal(t3$statistic, c(Z=-1.39077002573558))
expect_equal(t3$p.value, 0.164295175223054)
expect_equal(t3$conf.int[[1]], -0.2876917446341914)
expect_equal(t3$conf.int[[2]], 0.0488706064228094)
expect_match(t3$method, "DeLong")
expect_match(t3$method, "correlated")
expect_identical(t3$alternative, "two.sided")
expect_identical(attr(t3$conf.int, "conf.level"), 0.95)
})

test_that("two.sided roc.test produces identical p values when roc curves are reversed", {
Expand Down

0 comments on commit 4cb8634

Please sign in to comment.