Skip to content

Commit

Permalink
Test cov against issue #25
Browse files Browse the repository at this point in the history
  • Loading branch information
xrobin committed Apr 27, 2018
1 parent 06048ae commit 26b76d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-cov.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,20 @@ test_that("cov with different auc specifications warns", {
expect_warning(cov(r.wfns, auc(r.ndka.percent)))
expect_warning(cov(r.wfns, auc(r.ndka.percent)))
})


test_that("cov with delong, percent and direction = >", {
r1 <- roc(aSAH$outcome, -aSAH$ndka, percent=TRUE)
r2 <- roc(aSAH$outcome, -aSAH$s100b, percent=TRUE)
expect_equal(cov(r1, r2), -7.56164938056579)
})


test_that("cov with delong, percent, direction = > and mixed roc/auc", {
r1 <- roc(aSAH$outcome, -aSAH$ndka, percent=TRUE)
r2 <- roc(aSAH$outcome, -aSAH$s100b, percent=TRUE)
expect_equal(cov(r1, r2), -7.56164938056579)
expect_equal(cov(auc(r1), auc(r2)), -7.56164938056579)
expect_equal(cov(auc(r1), r2), -7.56164938056579)
expect_equal(cov(r1, auc(r2)), -7.56164938056579)
})

0 comments on commit 26b76d1

Please sign in to comment.