tests/testthat/test-med.test.R

test_that("Example 6.7", {
  expect_equal(med.test(ch6$males, ch6$females)$pval.exact,
               0.38454106)
})

test_that("Example 6.8", {
  tmp <- med.test(ch6$males, ch6$females, CI.width = 0.90)
  expect_equal(tmp$CI.exact.lower, -14.4)
  expect_equal(tmp$CI.exact.upper, 4)
  expect_equal(tmp$actualCIwidth, 0.9231884)
})

test_that("Example 7.4", {
  expect_equal(med.test(ch7$time, ch7$surgeon)$pval.exact, 0.046045976)
})

test_that("Example 7.5", {
  expect_equal(med.test(ch7$time, ch7$surgeon, do.exact = FALSE,
                           do.asymp = TRUE)$pval.asymp.stat, 11.152381)
  expect_equal(med.test(ch7$time, ch7$surgeon, do.exact = FALSE,
                           do.asymp = TRUE)$pval.asymp, 0.048441037)
})

Try the ANSM5 package in your browser

Any scripts or data that you put into this service are public.

ANSM5 documentation built on Sept. 11, 2024, 6:45 p.m.