From 507ee8b52e9656002ddb5378461dc19d15936fc3 Mon Sep 17 00:00:00 2001 From: Zelos Zhu Date: Thu, 11 Jan 2024 20:21:56 +0000 Subject: [PATCH] implement for lbt15 --- tests/testthat/_snaps/table_lbt15.md | 144 +++++++++++++++++++++------ tests/testthat/test-table_lbt15.R | 4 +- 2 files changed, 116 insertions(+), 32 deletions(-) diff --git a/tests/testthat/_snaps/table_lbt15.md b/tests/testthat/_snaps/table_lbt15.md index 66a419cb..3aca36f2 100644 --- a/tests/testthat/_snaps/table_lbt15.md +++ b/tests/testthat/_snaps/table_lbt15.md @@ -3,40 +3,124 @@ Code res Output - Category for Lab Test - Parameter A: Drug X B: Placebo C: Combination All Patients - Direction of Abnormality (N=134) (N=134) (N=132) (N=400) - ——————————————————————————————————————————————————————————————————————————————————————————————————————————— - CHEMISTRY - Alanine Aminotransferase Measurement - low 32/127 (25.2%) 32/128 (25%) 32/128 (25%) 96/383 (25.1%) - high 0/134 0/134 0/132 0/400 - C-Reactive Protein Measurement - low 36/127 (28.3%) 36/127 (28.3%) 42/123 (34.1%) 114/377 (30.2%) - high 34/124 (27.4%) 33/128 (25.8%) 31/129 (24%) 98/381 (25.7%) - IMMUNOLOGY - Immunoglobulin A Measurement - low 0/134 0/134 0/132 0/400 - high 33/128 (25.8%) 32/124 (25.8%) 28/120 (23.3%) 93/372 (25%) + Category for Lab Test + Parameter Placebo Xanomeline High Dose Xanomeline Low Dose All Patients + Direction of Abnormality (N=86) (N=84) (N=84) (N=306) + —————————————————————————————————————————————————————————————————————————————————————————————————————————————— + CHEMISTRY + Albumin (g/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Alkaline Phosphatase (U/L) + low 0/83 0/73 0/73 0/229 + high 2/83 (2.4%) 0/73 0/73 2/229 (0.9%) + Alanine Aminotransferase (U/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Aspartate Aminotransferase (U/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Bilirubin (umol/L) + low 0/83 0/73 0/73 0/229 + high 1/83 (1.2%) 0/73 0/73 1/229 (0.4%) + Calcium (mmol/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Cholesterol (mmol/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Creatinine Kinase (U/L) + low 0/83 0/73 0/74 0/230 + high 2/83 (2.4%) 1/73 (1.4%) 0/74 3/230 (1.3%) + Creatinine (umol/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Gamma Glutamyl Transferase (U/L) + low 0/83 0/73 0/74 0/230 + high 0/82 0/73 0/74 0/229 + Glucose (mmol/L) + low 0/83 0/73 0/74 0/230 + high 1/82 (1.2%) 6/73 (8.2%) 1/74 (1.4%) 8/229 (3.5%) + Phosphate (mmol/L) + low 1/83 (1.2%) 0/73 0/73 1/229 (0.4%) + high 0/83 0/73 0/73 0/229 + Potassium (mmol/L) + low 0/83 0/73 0/73 0/229 + high 0/83 0/73 0/73 0/229 + Sodium (mmol/L) + low 1/83 (1.2%) 0/73 0/74 1/230 (0.4%) + high 0/83 0/73 0/74 0/230 + HEMATOLOGY + Lymphocytes (10^9/L) + low 0/81 0/71 0/74 0/226 + high 0/81 0/71 0/74 0/226 + Platelet (10^9/L) + low 0/83 0/73 0/72 0/228 + high 0/83 0/73 0/72 0/228 + Leukocytes (10^9/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 # LBT15 variant 2 works as expected Code res Output - Category for Lab Test - Parameter A: Drug X B: Placebo C: Combination All Patients - Direction of Abnormality (N=134) (N=134) (N=132) (N=400) - ——————————————————————————————————————————————————————————————————————————————————————————————————————————— - CHEMISTRY - Alanine Aminotransferase Measurement - low 46/119 (38.7%) 54/123 (43.9%) 47/127 (37%) 147/369 (39.8%) - high 0/134 0/134 0/132 0/400 - C-Reactive Protein Measurement - low 59/122 (48.4%) 56/118 (47.5%) 58/121 (47.9%) 173/361 (47.9%) - high 54/122 (44.3%) 46/122 (37.7%) 44/122 (36.1%) 144/366 (39.3%) - IMMUNOLOGY - Immunoglobulin A Measurement - low 0/134 0/134 0/132 0/400 - high 47/124 (37.9%) 54/120 (45%) 47/115 (40.9%) 148/359 (41.2%) + Category for Lab Test + Parameter Placebo Xanomeline High Dose Xanomeline Low Dose All Patients + Direction of Abnormality (N=86) (N=84) (N=84) (N=306) + ——————————————————————————————————————————————————————————————————————————————————————————————————————————————— + CHEMISTRY + Albumin (g/L) + low 2/83 (2.4%) 0/73 0/74 2/230 (0.9%) + high 0/83 0/73 0/74 0/230 + Alkaline Phosphatase (U/L) + low 0/83 0/73 0/73 0/229 + high 1/82 (1.2%) 0/72 0/73 1/227 (0.4%) + Alanine Aminotransferase (U/L) + low 0/83 0/73 0/74 0/230 + high 2/83 (2.4%) 1/73 (1.4%) 0/74 3/230 (1.3%) + Aspartate Aminotransferase (U/L) + low 0/83 0/73 0/74 0/230 + high 2/83 (2.4%) 1/73 (1.4%) 1/74 (1.4%) 4/230 (1.7%) + Bilirubin (umol/L) + low 0/83 0/73 0/73 0/229 + high 1/83 (1.2%) 2/72 (2.8%) 1/73 (1.4%) 4/228 (1.8%) + Calcium (mmol/L) + low 0/83 2/73 (2.7%) 1/74 (1.4%) 3/230 (1.3%) + high 0/83 0/73 0/74 0/230 + Cholesterol (mmol/L) + low 0/83 0/73 0/74 0/230 + high 2/79 (2.5%) 0/71 2/73 (2.7%) 4/223 (1.8%) + Creatinine Kinase (U/L) + low 0/83 0/73 0/74 0/230 + high 5/83 (6%) 1/73 (1.4%) 1/73 (1.4%) 7/229 (3.1%) + Creatinine (umol/L) + low 0/83 0/73 0/74 0/230 + high 0/83 0/73 0/74 0/230 + Gamma Glutamyl Transferase (U/L) + low 0/83 0/73 0/74 0/230 + high 0/82 2/73 (2.7%) 0/74 2/229 (0.9%) + Glucose (mmol/L) + low 1/83 (1.2%) 0/73 2/74 (2.7%) 3/230 (1.3%) + high 1/82 (1.2%) 6/73 (8.2%) 1/74 (1.4%) 8/229 (3.5%) + Phosphate (mmol/L) + low 5/83 (6%) 4/73 (5.5%) 2/73 (2.7%) 11/229 (4.8%) + high 0/83 0/73 0/73 0/229 + Potassium (mmol/L) + low 3/83 (3.6%) 2/73 (2.7%) 2/73 (2.7%) 7/229 (3.1%) + high 0/82 1/73 (1.4%) 0/73 1/228 (0.4%) + Sodium (mmol/L) + low 1/83 (1.2%) 0/73 0/74 1/230 (0.4%) + high 0/83 2/73 (2.7%) 0/74 2/230 (0.9%) + HEMATOLOGY + Lymphocytes (10^9/L) + low 1/80 (1.2%) 0/71 1/74 (1.4%) 2/225 (0.9%) + high 0/81 0/71 0/74 0/226 + Platelet (10^9/L) + low 0/83 0/73 0/72 0/228 + high 0/83 0/73 0/72 0/228 + Leukocytes (10^9/L) + low 0/83 1/73 (1.4%) 1/74 (1.4%) 2/230 (0.9%) + high 0/83 0/73 0/74 0/230 diff --git a/tests/testthat/test-table_lbt15.R b/tests/testthat/test-table_lbt15.R index 93339ec8..04008db7 100644 --- a/tests/testthat/test-table_lbt15.R +++ b/tests/testthat/test-table_lbt15.R @@ -1,5 +1,5 @@ -adsl <- adsl_raw -adlb <- adlb_raw +adsl <- adsl_pharmaverse +adlb <- adlb_pharmaverse adlb <- adlb %>% mutate(