Skip to content

Commit

Permalink
workking version of lbt03
Browse files Browse the repository at this point in the history
  • Loading branch information
zdz2101 committed Jan 10, 2024
1 parent 9d2912b commit e2c3dc0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 37 deletions.
51 changes: 18 additions & 33 deletions tests/testthat/_snaps/table_lbt03.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,22 @@
Code
res
Output
A: Drug X B: Placebo C: Combination
(N=134) (N=134) (N=132)
————————————————————————————————————————————————————————————————
BASELINE
n 134 134 132
Mean (SD) 17.74 (9.93) 18.71 (9.83) 19.46 (9.08)
Median 17.46 18.19 18.97
Min - Max 0.00 - 44.06 1.48 - 54.40 0.57 - 39.81
WEEK 1 DAY 8
n 134 134 132
Mean (SD) -0.99 (13.49) 0.23 (14.26) 0.14 (12.85)
Median -1.28 -1.54 0.06
Min - Max -31.31 - 27.89 -30.72 - 33.92 -32.45 - 38.85
WEEK 2 DAY 15
n 134 134 132
Mean (SD) 0.08 (14.15) 0.11 (14.45) -2.92 (12.64)
Median 0.28 -0.93 -1.11
Min - Max -32.89 - 40.55 -45.93 - 29.85 -28.36 - 23.98
WEEK 3 DAY 22
n 134 134 132
Mean (SD) 0.63 (13.85) -1.06 (13.58) -2.71 (13.22)
Median 1.13 -0.49 -2.66
Min - Max -40.09 - 31.24 -46.30 - 31.38 -30.63 - 26.51
WEEK 4 DAY 29
n 134 134 132
Mean (SD) 1.44 (15.39) -1.48 (15.20) -1.54 (12.63)
Median 0.88 -2.96 -1.53
Min - Max -32.93 - 46.98 -41.45 - 43.08 -30.33 - 27.99
WEEK 5 DAY 36
n 134 134 132
Mean (SD) 1.48 (14.49) -0.69 (14.65) -0.95 (12.92)
Median 2.31 1.82 -2.48
Min - Max -40.08 - 30.07 -47.60 - 26.04 -29.78 - 25.00
Placebo Xanomeline High Dose Xanomeline Low Dose
(N=86) (N=84) (N=84)
—————————————————————————————————————————————————————————————————————————
Baseline
n 86 84 82
Mean (SD) 17.57 (9.22) 19.20 (10.05) 17.96 (8.72)
Median 15.00 16.00 17.00
Min - Max 7.00 - 69.00 6.00 - 64.00 5.00 - 70.00
Week 2
n 83 78 80
Mean (SD) 0.29 (7.80) 1.72 (6.85) 2.78 (7.03)
Median -1.00 2.00 2.50
Min - Max -14.00 - 54.00 -31.00 - 17.00 -28.00 - 22.00
Week 4
n 79 72 72
Mean (SD) 0.80 (8.50) 2.25 (7.00) -0.62 (4.35)
Median 0.00 1.00 0.00
Min - Max -13.00 - 57.00 -28.00 - 21.00 -16.00 - 12.00

8 changes: 4 additions & 4 deletions tests/testthat/test-table_lbt03.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Tests the single variant for LBT03

adsl <- adsl_raw
adlb <- adlb_raw
adsl <- adsl_pharmaverse
adlb <- adlb_pharmaverse

testthat::test_that("LBT03 default variant is produced correctly", {
adlb_f <- adlb %>%
dplyr::filter(AVISIT != "SCREENING", PARAMCD == "ALT") %>%
dplyr::filter(AVISIT %in% c("Baseline", "Week 2", "Week 4") & PARAMCD == "ALT") %>%
dplyr::mutate(
AVISIT = droplevels(AVISIT),
ABLFL = ifelse(AVISIT == "Baseline", "Y", ""), # original adlb_pharmaverse ABLFL is unreliable
ABLFLL = ABLFL == "Y"
)

Expand Down

0 comments on commit e2c3dc0

Please sign in to comment.