tests/testthat/test-hybrid-workflows.R

test_that("hybrid testing and power workflows run", {
  set.seed(111)
  study <- case.studies(1, Continuous = TRUE, WithEstimation = FALSE)
  x <- study$ralt(study$param_alt[2L])
  extra <- list(which = "statistic", nbins = c(3, 4))

  test_result <- hybrid_test(
    x, study$rnull, nMC = 2,
    TS = MD2sample::chiTS.cont, TSextra = extra,
    B = 10, maxProcessor = 1
  )
  expect_type(test_result, "list")
  expect_true(any(c("p.value", "p.values") %in% names(test_result)))

  power_result <- hybrid_power(
    study$rnull, study$ralt, study$param_alt[2L], nMC = 2,
    TS = MD2sample::chiTS.cont, TSextra = extra,
    B = 10, maxProcessor = 1
  )
  expect_probability_output(power_result)
})

Try the MDgof package in your browser

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

MDgof documentation built on Sept. 23, 2026, 5:08 p.m.