Nothing
test_that("analyse ahr works", {
capture.output({
condition <- merge(
assumptions_delayed_effect(),
design_fixed_followup(),
by=NULL
) |>
head(1)
})
dat <- generate_delayed_effect(condition)
expect_type(analyse_ahr(), "closure")
expect_error(analyse_ahr(type="something else"))
results1 <- analyse_ahr()(condition, dat)
results2 <- analyse_ahr(type="gAHR")(condition, dat)
results3 <- analyse_ahr(max_time=50, type="AHR") (condition, dat)
results4 <- analyse_ahr(max_time=50, type="gAHR", alternative="one.sided")(condition, dat)
results5 <- analyse_ahr(max_time=c(50, 100), type="gAHR", alternative="one.sided")(condition, dat)
expect_type(results1, "list")
expect_s3_class(results1, NA)
expect_named(results1, c("p", "alternative", "AHR", "AHR_lower", "AHR_upper", "CI_level", "N_pat", "N_evt"))
expect_type(results2, "list")
expect_s3_class(results2, NA)
expect_named(results2, c("p", "alternative", "gAHR", "gAHR_lower", "gAHR_upper", "CI_level", "N_pat", "N_evt"))
expect_type(results3, "list")
expect_s3_class(results3, NA)
expect_named(results3, c("p", "alternative", "AHR", "AHR_lower", "AHR_upper", "CI_level", "N_pat", "N_evt"))
expect_type(results4, "list")
expect_s3_class(results4, NA)
expect_named(results4, c("p", "alternative", "gAHR", "gAHR_lower", "gAHR_upper", "CI_level", "N_pat", "N_evt"))
expect_equal(length(results4$gAHR), 1)
expect_type(results5, "list")
expect_s3_class(results5, NA)
expect_named(results5, c("p", "alternative", "gAHR", "gAHR_lower", "gAHR_upper", "CI_level", "N_pat", "N_evt"))
expect_equal(length(results5$gAHR), 2)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.