Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pharmaverseadam data in safety templates - part 2 #154

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 143 additions & 98 deletions tests/testthat/_snaps/table_egt01.md

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions tests/testthat/_snaps/table_egt02.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
Code
res
Output
Assessment A: Drug X B: Placebo C: Combination
Abnormality (N=134) (N=134) (N=132)
————————————————————————————————————————————————————————————————
Heart Rate
Low 40/134 (29.9%) 43/134 (32.1%) 37/132 (28%)
High 39/134 (29.1%) 45/134 (33.6%) 36/132 (27.3%)
QT Duration
Low 33/134 (24.6%) 44/134 (32.8%) 47/132 (35.6%)
High 30/134 (22.4%) 42/134 (31.3%) 34/132 (25.8%)
RR Duration
Low 45/134 (33.6%) 26/134 (19.4%) 38/132 (28.8%)
High 29/134 (21.6%) 49/134 (36.6%) 27/132 (20.5%)
Assessment Placebo Xanomeline High Dose Xanomeline Low Dose
Abnormality (N=86) (N=72) (N=96)
———————————————————————————————————————————————————————————————————————————————————
Heart Rate (beats/min)
Low 0/84 0/72 0/94
High 6/84 (7.1%) 4/72 (5.6%) 6/94 (6.4%)
QT Duration (msec)
Low 23/84 (27.4%) 15/72 (20.8%) 21/94 (22.3%)
High 70/84 (83.3%) 66/72 (91.7%) 85/94 (90.4%)
RR Duration (msec)
Low 84/84 (100%) 71/72 (98.6%) 90/94 (95.7%)
High 0/84 0/72 0/94

# (EGT02) 2. Among Subjects Without Abnormality at Baseline

Code
res
Output
Assessment A: Drug X B: Placebo C: Combination
Abnormality (N=134) (N=134) (N=132)
————————————————————————————————————————————————————————————————
Heart Rate
Low 39/128 (30.5%) 42/124 (33.9%) 33/117 (28.2%)
High 37/127 (29.1%) 43/129 (33.3%) 31/122 (25.4%)
QT Duration
Low 29/113 (25.7%) 42/126 (33.3%) 43/124 (34.7%)
High 30/125 (24%) 40/130 (30.8%) 30/119 (25.2%)
RR Duration
Low 45/129 (34.9%) 26/123 (21.1%) 37/126 (29.4%)
High 27/127 (21.3%) 43/122 (35.2%) 25/125 (20%)
Assessment Placebo Xanomeline High Dose Xanomeline Low Dose
Abnormality (N=86) (N=72) (N=96)
———————————————————————————————————————————————————————————————————————————————————
Heart Rate (beats/min)
Low 0/84 0/72 0/94
High 5/84 (6%) 4/72 (5.6%) 6/94 (6.4%)
QT Duration (msec)
Low 23/84 (27.4%) 15/72 (20.8%) 20/94 (21.3%)
High 69/84 (82.1%) 65/72 (90.3%) 81/94 (86.2%)
RR Duration (msec)
Low 83/84 (98.8%) 71/72 (98.6%) 90/94 (95.7%)
High 0/84 0/72 0/94

157 changes: 80 additions & 77 deletions tests/testthat/_snaps/table_egt03.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,99 +3,102 @@
Code
res
Output
LOW NORMAL HIGH Missing
——————————————————————————————————————————————————————————————————
A: Drug X (N=134)
n 40 92 0 2
LOW 1 (0.7%) 5 (3.7%) 0 0
NORMAL 36 (26.9%) 83 (61.9%) 0 1 (0.7%)
HIGH 2 (1.5%) 4 (3%) 0 0
Missing 1 (0.7%) 0 0 1 (0.7%)
B: Placebo (N=134)
n 43 89 0 2
LOW 1 (0.7%) 9 (6.7%) 0 0
NORMAL 40 (29.9%) 75 (56%) 0 2 (1.5%)
HIGH 1 (0.7%) 4 (3%) 0 0
Missing 1 (0.7%) 1 (0.7%) 0 0
C: Combination (N=132)
n 37 94 0 1
LOW 4 (3%) 11 (8.3%) 0 0
NORMAL 31 (23.5%) 75 (56.8%) 0 0
HIGH 1 (0.8%) 8 (6.1%) 0 1 (0.8%)
Missing 1 (0.8%) 0 0 0
LOW NORMAL HIGH Missing
———————————————————————————————————————————————————————————————————————————
Placebo (N=336)
n 0 331 3 2
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 0 243 (72.3%) 2 (0.6%) 0
HIGH 0 5 (1.5%) 0 0
Missing 0 0 0 2 (0.6%)
Xanomeline High Dose (N=324)
n 0 321 3 0
LOW 0 80 (24.7%) 1 (0.3%) 0
NORMAL 0 241 (74.4%) 2 (0.6%) 0
HIGH 0 0 0 0
Missing 0 0 0 0
Xanomeline Low Dose (N=336)
n 1 326 6 3
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 1 (0.3%) 242 (72%) 5 (1.5%) 0
HIGH 0 1 (0.3%) 0 0
Missing 0 0 0 3 (0.9%)

# EGT03 variant 2 is produced correctly

Code
res
Output
LOW NORMAL HIGH
———————————————————————————————————————————————————————
A: Drug X (N=134)
n 40 94 0
LOW 1 (0.7%) 5 (3.7%) 0
NORMAL 36 (26.9%) 84 (62.7%) 0
HIGH 2 (1.5%) 4 (3%) 0
Missing 1 (0.7%) 1 (0.7%) 0
B: Placebo (N=134)
n 43 91 0
LOW 1 (0.7%) 9 (6.7%) 0
NORMAL 40 (29.9%) 77 (57.5%) 0
HIGH 1 (0.7%) 4 (3%) 0
Missing 1 (0.7%) 1 (0.7%) 0
C: Combination (N=132)
n 37 95 0
LOW 4 (3%) 11 (8.3%) 0
NORMAL 31 (23.5%) 75 (56.8%) 0
HIGH 1 (0.8%) 9 (6.8%) 0
Missing 1 (0.8%) 0 0
NORMAL LOW HIGH
————————————————————————————————————————————————————————————————
Placebo (N=336)
n 333 0 3
LOW 83 (24.7%) 0 1 (0.3%)
NORMAL 243 (72.3%) 0 2 (0.6%)
HIGH 5 (1.5%) 0 0
Missing 2 (0.6%) 0 0
Xanomeline High Dose (N=324)
n 321 0 3
LOW 80 (24.7%) 0 1 (0.3%)
NORMAL 241 (74.4%) 0 2 (0.6%)
HIGH 0 0 0
Missing 0 0 0
Xanomeline Low Dose (N=336)
n 329 1 6
LOW 83 (24.7%) 0 1 (0.3%)
NORMAL 242 (72%) 1 (0.3%) 5 (1.5%)
HIGH 1 (0.3%) 0 0
Missing 3 (0.9%) 0 0

# EGT03 variant 3 is produced correctly

Code
res
Output
LOW NORMAL HIGH Missing
——————————————————————————————————————————————————————————————————
A: Drug X (N=134)
n 39 93 0 2
LOW 1 (0.7%) 5 (3.7%) 0 0
NORMAL 36 (26.9%) 84 (62.7%) 0 1 (0.7%)
HIGH 2 (1.5%) 4 (3%) 0 1 (0.7%)
B: Placebo (N=134)
n 42 90 0 2
LOW 1 (0.7%) 9 (6.7%) 0 0
NORMAL 40 (29.9%) 77 (57.5%) 0 2 (1.5%)
HIGH 1 (0.7%) 4 (3%) 0 0
C: Combination (N=132)
n 36 95 0 1
LOW 4 (3%) 11 (8.3%) 0 0
NORMAL 31 (23.5%) 75 (56.8%) 0 1 (0.8%)
HIGH 1 (0.8%) 9 (6.8%) 0 0
LOW NORMAL HIGH Missing
———————————————————————————————————————————————————————————————————————————
Placebo (N=336)
n 0 331 3 2
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 0 243 (72.3%) 2 (0.6%) 0
HIGH 0 5 (1.5%) 0 0
Missing 0 0 0 2 (0.6%)
Xanomeline High Dose (N=324)
n 0 321 3 0
LOW 0 80 (24.7%) 1 (0.3%) 0
NORMAL 0 241 (74.4%) 2 (0.6%) 0
HIGH 0 0 0 0
Missing 0 0 0 0
Comment on lines +60 to +71
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's check if this is expected, and if it makes sense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zero counts for low

Xanomeline Low Dose (N=336)
n 1 326 6 3
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 1 (0.3%) 242 (72%) 5 (1.5%) 0
HIGH 0 1 (0.3%) 0 0
Missing 0 0 0 3 (0.9%)

# EGT03 variant 4 is produced correctly

Code
res
Output
LOW NORMAL HIGH Missing
—————————————————————————————————————————————————————————————————
A: Drug X (N=134)
n 0 95 37 2
LOW 0 2 (1.5%) 4 (3%) 0
NORMAL 0 88 (65.7%) 31 (23.1%) 1 (0.7%)
HIGH 0 5 (3.7%) 1 (0.7%) 0
Missing 0 0 1 (0.7%) 1 (0.7%)
B: Placebo (N=134)
n 0 88 44 2
LOW 0 8 (6%) 2 (1.5%) 0
NORMAL 0 76 (56.7%) 39 (29.1%) 2 (1.5%)
HIGH 0 3 (2.2%) 2 (1.5%) 0
Missing 0 1 (0.7%) 1 (0.7%) 0
C: Combination (N=132)
n 0 96 35 1
LOW 0 12 (9.1%) 3 (2.3%) 0
NORMAL 0 79 (59.8%) 27 (20.5%) 0
HIGH 0 5 (3.8%) 4 (3%) 1 (0.8%)
Missing 0 0 1 (0.8%) 0
LOW NORMAL HIGH Missing
———————————————————————————————————————————————————————————————————————————
Placebo (N=336)
n 0 331 3 2
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 0 243 (72.3%) 2 (0.6%) 0
HIGH 0 5 (1.5%) 0 0
Missing 0 0 0 2 (0.6%)
Xanomeline High Dose (N=324)
n 0 321 3 0
LOW 0 80 (24.7%) 1 (0.3%) 0
NORMAL 0 241 (74.4%) 2 (0.6%) 0
HIGH 0 0 0 0
Comment on lines +87 to +96
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zero counts for low , lets check

Missing 0 0 0 0
Xanomeline Low Dose (N=336)
n 1 326 6 3
LOW 0 83 (24.7%) 1 (0.3%) 0
NORMAL 1 (0.3%) 242 (72%) 5 (1.5%) 0
HIGH 0 1 (0.3%) 0 0
Missing 0 0 0 3 (0.9%)

28 changes: 14 additions & 14 deletions tests/testthat/_snaps/table_egt04.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
Code
res
Output
Normal Abnormal Missing
———————————————————————————————————————————————————————————
A: Drug X (N=134)
Normal 20 (14.9%) 81 (60.4%) 1 (0.7%)
Abnormal 11 (8.2%) 19 (14.2%) 0
Missing 0 1 (0.7%) 1 (0.7%)
B: Placebo (N=134)
Normal 18 (13.4%) 81 (60.4%) 2 (1.5%)
Abnormal 3 (2.2%) 28 (20.9%) 0
Missing 0 2 (1.5%) 0
C: Combination (N=132)
Normal 26 (19.7%) 69 (52.3%) 1 (0.8%)
Abnormal 6 (4.5%) 29 (22%) 0
Missing 1 (0.8%) 0 0
Normal Abnormal Missing
———————————————————————————————————————————————————————————————
Placebo (N=145)
Normal 73 (50.3%) 0 1 (0.7%)
Abnormal 38 (26.2%) 1 (0.7%) 2 (1.4%)
Missing 30 (20.7%) 0 0
Xanomeline High Dose (N=113)
Normal 45 (39.8%) 9 (8%) 1 (0.9%)
Abnormal 27 (23.9%) 7 (6.2%) 0
Missing 23 (20.4%) 1 (0.9%) 0
Xanomeline Low Dose (N=119)
Normal 52 (43.7%) 8 (6.7%) 0
Abnormal 30 (25.2%) 3 (2.5%) 0
Missing 25 (21%) 0 1 (0.8%)

Loading
Loading