Skip to content

Commit

Permalink
working version of lbt06
Browse files Browse the repository at this point in the history
  • Loading branch information
zdz2101 committed Jan 10, 2024
1 parent e2c3dc0 commit 5a5fefa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 53 deletions.
89 changes: 40 additions & 49 deletions tests/testthat/_snaps/table_lbt06.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,44 @@
Code
res
Output
A: Drug X B: Placebo C: Combination
(N=134) (N=134) (N=132)
———————————————————————————————————————————————————————————————————————————————————————
Alanine Aminotransferase Measurement
WEEK 1 DAY 8
Low
Not low 19/113 (16.8%) 13/117 (11.1%) 14/123 (11.4%)
Low 2/21 (9.5%) 1/17 (5.9%) 1/9 (11.1%)
Total 21/134 (15.7%) 14/134 (10.4%) 15/132 (11.4%)
High
Not high 0/134 0/134 0/132
High 0/0 0/0 0/0
Total 0/134 0/134 0/132
WEEK 2 DAY 15
Low
Not low 17/113 (15%) 13/117 (11.1%) 13/123 (10.6%)
Low 2/21 (9.5%) 2/17 (11.8%) 4/9 (44.4%)
Total 19/134 (14.2%) 15/134 (11.2%) 17/132 (12.9%)
High
Not high 0/134 0/134 0/132
High 0/0 0/0 0/0
Total 0/134 0/134 0/132
WEEK 3 DAY 22
Low
Not low 10/113 (8.8%) 20/117 (17.1%) 21/123 (17.1%)
Low 4/21 (19%) 4/17 (23.5%) 2/9 (22.2%)
Total 14/134 (10.4%) 24/134 (17.9%) 23/132 (17.4%)
High
Not high 0/134 0/134 0/132
High 0/0 0/0 0/0
Total 0/134 0/134 0/132
WEEK 4 DAY 29
Low
Not low 15/113 (13.3%) 19/117 (16.2%) 18/123 (14.6%)
Low 2/21 (9.5%) 3/17 (17.6%) 1/9 (11.1%)
Total 17/134 (12.7%) 22/134 (16.4%) 19/132 (14.4%)
High
Not high 0/134 0/134 0/132
High 0/0 0/0 0/0
Total 0/134 0/134 0/132
WEEK 5 DAY 36
Low
Not low 17/113 (15%) 23/117 (19.7%) 18/123 (14.6%)
Low 0/21 1/17 (5.9%) 1/9 (11.1%)
Total 17/134 (12.7%) 24/134 (17.9%) 19/132 (14.4%)
High
Not high 0/134 0/134 0/132
High 0/0 0/0 0/0
Total 0/134 0/134 0/132
Placebo Xanomeline High Dose Xanomeline Low Dose
(N=86) (N=84) (N=84)
—————————————————————————————————————————————————————————————————————————————————————————
Alanine Aminotransferase (U/L)
Week 2
Low
Not low 0/83 0/78 1/79 (1.3%)
Low 0/0 0/0 0/1
Total 0/83 0/78 1/80 (1.2%)
High
Not high 1/79 (1.3%) 1/73 (1.4%) 2/78 (2.6%)
High 2/4 (50%) 4/5 (80%) 2/2 (100%)
Total 3/83 (3.6%) 5/78 (6.4%) 4/80 (5%)
Week 4
Low
Not low 0/79 0/72 1/72 (1.4%)
Low 0/0 0/0 0/0
Total 0/79 0/72 1/72 (1.4%)
High
Not high 2/75 (2.7%) 2/68 (2.9%) 0/70
High 3/4 (75%) 3/4 (75%) 1/2 (50%)
Total 5/79 (6.3%) 5/72 (6.9%) 1/72 (1.4%)
Week 6
Low
Not low 1/73 (1.4%) 0/66 2/62 (3.2%)
Low 0/0 0/0 0/0
Total 1/73 (1.4%) 0/66 2/62 (3.2%)
High
Not high 2/70 (2.9%) 1/62 (1.6%) 1/60 (1.7%)
High 2/3 (66.7%) 3/4 (75%) 1/2 (50%)
Total 4/73 (5.5%) 4/66 (6.1%) 2/62 (3.2%)
Week 8
Low
Not low 0/72 0/56 1/60 (1.7%)
Low 0/0 0/0 0/0
Total 0/72 0/56 1/60 (1.7%)
High
Not high 2/69 (2.9%) 2/52 (3.8%) 1/58 (1.7%)
High 2/3 (66.7%) 1/4 (25%) 1/2 (50%)
Total 4/72 (5.6%) 3/56 (5.4%) 2/60 (3.3%)

7 changes: 3 additions & 4 deletions tests/testthat/test-table_lbt06.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Tests all variants of LBT06

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

testthat::test_that("LBT06 default variant is produced correctly", {
adlb <- adlb %>%
dplyr::filter(PARAMCD == "ALT") %>%
dplyr::filter(!(AVISIT %in% c("SCREENING", "BASELINE"))) %>%
dplyr::mutate(AVISIT = droplevels(AVISIT))
dplyr::filter(AVISIT %in% c("Week 2", "Week 4", "Week 6", "Week 8"))

result <- basic_table() %>%
split_cols_by("ARM") %>%
Expand Down

0 comments on commit 5a5fefa

Please sign in to comment.