tests/testthat/test-matched_or.R

context("matched_or is working")
library(catfun)

test_that("outputting correct values", {

  set.seed(1)
  gene <- data.frame(pair = seq(1:35),
                     ulcer = rbinom(35, 1, .7),
                     healthy = rbinom(35, 1, .4))

  x <- matched_or(gene, ulcer, healthy)

  expect_equal(x$or$odds_ratio, 0.375)
  expect_equal(round(x$or$lower_bound, 4), 0.1467)
  expect_equal(round(x$or$upper_bound, 4), 0.9583)
})

Try the catfun package in your browser

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

catfun documentation built on June 14, 2019, 5:04 p.m.