tests/testthat/test-regress-anohe.R

context("Regressions previously observed for ANOHE")

test_that("anohe-breaking.txt does not break summary.mtc.anohe", {
  network <- dget("../data/anohe-breaking.txt")
  capture.output(anohe <- mtc.anohe(network, n.adapt=200, n.iter=500))
  x <- summary(anohe)
  expect_true('studyEffects' %in% names(x))
})

test_that("Mixing up the order of treatments does not break summary.mtc.anohe", {
  network <- thrombolytic
  treatments <- network$treatments
  treatments$id <- factor(rev(as.character(treatments$id)), levels=rev(as.character(treatments$id)))
  network <- mtc.network(data=network$data.ab, treatments=treatments)
  capture.output(anohe <- mtc.anohe(network, n.adapt=200, n.iter=500))
  x <- summary(anohe)
  expect_true('studyEffects' %in% names(x))
})

Try the gemtc package in your browser

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

gemtc documentation built on July 9, 2023, 5:33 p.m.