diff --git a/DESCRIPTION b/DESCRIPTION index 9da68eb2..9596764b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -49,4 +49,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.1 diff --git a/tests/testthat/_snaps/table_ratet01.md b/tests/testthat/_snaps/table_ratet01.md deleted file mode 100644 index 0b73ce09..00000000 --- a/tests/testthat/_snaps/table_ratet01.md +++ /dev/null @@ -1,28 +0,0 @@ -# RATET01 is produced correctly - - Code - res - Output - B: Placebo A: Drug X C: Combination - (N=134) (N=134) (N=132) - —————————————————————————————————————————————————————————————————————————————————————————————————————— - Number of exacerbations per patient - 0 10 (7.46%) 6 (4.48%) 11 (8.33%) - 1 25 (18.66%) 21 (15.67%) 14 (10.61%) - 2 38 (28.36%) 41 (30.60%) 33 (25.00%) - 3 22 (16.42%) 26 (19.40%) 21 (15.91%) - 4 13 (9.70%) 18 (13.43%) 30 (22.73%) - 5 11 (8.21%) 10 (7.46%) 12 (9.09%) - 6 10 (7.46%) 7 (5.22%) 7 (5.30%) - 7 3 (2.24%) 4 (2.99%) 3 (2.27%) - 8 1 (0.75%) 1 (0.75%) 1 (0.76%) - 9 1 (0.75%) 0 (0.00%) 0 (0.00%) - Unadjusted exacerbation rate (per year) - Rate 7.2364 8.2148 9.8131 - Adjusted (QP) exacerbation rate (per year) - Rate 7.1215 8.2714 9.9508 - Rate CI (4.6899, 10.8140) (5.5080, 12.4212) (6.6579, 14.8723) - Rate Ratio 1.1615 1.3973 - Rate Ratio CI (0.6462, 2.0877) (0.7789, 2.5067) - p value 0.6169 0.2619 - diff --git a/tests/testthat/test-table_ratet01.R b/tests/testthat/test-table_ratet01.R deleted file mode 100644 index a39dd314..00000000 --- a/tests/testthat/test-table_ratet01.R +++ /dev/null @@ -1,53 +0,0 @@ -anl <- adtte_raw %>% filter(PARAMCD == "TNE") - -# Ensure number of exacerbation is a factor and NAs are explicit missing levels. -anl$AVAL_f <- as.factor(anl$AVAL) -anl <- df_explicit_na(anl) - -testthat::test_that("RATET01 is produced correctly", { - lyt <- basic_table(show_colcounts = TRUE) %>% - split_cols_by("ARM", - ref_group = "B: Placebo", - split_fun = ref_group_position("first") - ) %>% - analyze_vars( - "AVAL_f", - var_labels = "Number of exacerbations per patient", - .stats = c("count_fraction"), - .formats = c("count_fraction" = "xx (xx.xx%)"), - .label = c("Number of exacerbations per patient") - ) %>% - summarize_glm_count( - vars = "AVAL", - variables = list(arm = "ARM", offset = "lgTMATRSK", covariates = NULL), - conf_level = 0.95, - distribution = "poisson", - rate_mean_method = "emmeans", - var_labels = "Unadjusted exacerbation rate (per year)", - table_names = "unadj", - .stats = c("rate"), - .labels = c(rate = "Rate") - ) %>% - summarize_glm_count( - vars = "AVAL", - variables = list(arm = "ARM", offset = "lgTMATRSK", covariates = c("REGION1")), - conf_level = 0.95, - distribution = "quasipoisson", - rate_mean_method = "ppmeans", - var_labels = "Adjusted (QP) exacerbation rate (per year)", - table_names = "adj", - .stats = c("rate", "rate_ci", "rate_ratio", "rate_ratio_ci", "pval"), - .labels = c( - rate = "Rate", rate_ci = "Rate CI", rate_ratio = "Rate Ratio", - rate_ratio_ci = "Rate Ratio CI", pval = "p value" - ) - ) - - result <- build_table( - lyt = lyt, - df = anl - ) - - res <- testthat::expect_silent(result) - testthat::expect_snapshot(res) -})