Skip to content

Commit

Permalink
Update sig fig formatting in ADA/PK tables (#129)
Browse files Browse the repository at this point in the history
Closes #118
  • Loading branch information
edelarua authored Sep 25, 2023
1 parent e7d6c82 commit f0bf380
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 274 deletions.
12 changes: 6 additions & 6 deletions book/tables/ADA/adat03.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ adat03_lbls <- c(
)
adat03_fmts <- c(
n = "xx.",
mean = sprintf_format("%.3e"),
sd = sprintf_format("%.3e"),
median = sprintf_format("%.3e"),
min = sprintf_format("%.3e"),
max = sprintf_format("%.3e"),
mean = format_sigfig(3),
sd = format_sigfig(3),
median = format_sigfig(3),
min = format_sigfig(3),
max = format_sigfig(3),
cv = "xx.x",
geom_mean = sprintf_format("%.3e"),
geom_mean = format_sigfig(3),
count_fraction = format_count_fraction
)
Expand Down
9 changes: 4 additions & 5 deletions book/tables/pharmacokinetic/pkpt02.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ lyt <- basic_table() %>%
.stats = c("n", "mean_sd", "cv", "geom_mean", "geom_cv", "median", "range"),
.formats = c(
n = "xx.",
mean_sd = sprintf_format("%.3e (%.3e)"),
mean_sd = format_sigfig(3, "xx (xx)"),
cv = "xx.x",
geom_mean = sprintf_format("%.3e"),
geom_mean = format_sigfig(3),
geom_cv = "xx.x",
median = sprintf_format("%.3e"),
range = sprintf_format("%.3e - %.3e")
median = format_sigfig(3),
range = format_sigfig(3, "xx - xx")
)
)
```
Expand Down Expand Up @@ -93,5 +93,4 @@ result
```

{{< include ../../repro.qmd >}}

:::
9 changes: 4 additions & 5 deletions book/tables/pharmacokinetic/pkpt04.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ lyt <- basic_table() %>%
.stats = c("n", "mean_sd", "cv", "geom_mean", "geom_cv", "median", "range"),
.formats = c(
n = "xx.",
mean_sd = sprintf_format("%.3e (%.3e)"),
mean_sd = format_sigfig(3, "xx (xx)"),
cv = "xx.x",
geom_mean = sprintf_format("%.3e"),
geom_mean = format_sigfig(3),
geom_cv = "xx.x",
median = sprintf_format("%.3e"),
range = sprintf_format("%.3e - %.3e")
median = format_sigfig(3),
range = format_sigfig(3, "xx - xx")
)
)
```
Expand Down Expand Up @@ -93,5 +93,4 @@ result
```

{{< include ../../repro.qmd >}}

:::
12 changes: 6 additions & 6 deletions book/tables/pharmacokinetic/pkpt05.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ lyt <- basic_table() %>%
),
.formats = c(
n = "xx.",
mean = sprintf_format("%.3e"),
sd = sprintf_format("%.3e"),
mean = format_sigfig(3),
sd = format_sigfig(3),
cv = "xx.x",
median = sprintf_format("%.3e"),
geom_mean = sprintf_format("%.3e"),
median = format_sigfig(3),
geom_mean = format_sigfig(3),
geom_cv = "xx.x",
min = sprintf_format("%.3e"),
max = sprintf_format("%.3e")
min = format_sigfig(3),
max = format_sigfig(3)
)
)
```
Expand Down
9 changes: 4 additions & 5 deletions book/tables/pharmacokinetic/pkpt06.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ lyt <- basic_table() %>%
.stats = c("n", "mean_sd", "cv", "geom_mean", "geom_cv", "median", "range"),
.formats = c(
n = "xx.",
mean_sd = sprintf_format("%.3e (%.3e)"),
mean_sd = format_sigfig(3, "xx (xx)"),
cv = "xx.x",
geom_mean = sprintf_format("%.3e"),
geom_mean = format_sigfig(3),
geom_cv = "xx.x",
median = sprintf_format("%.3e"),
range = sprintf_format("%.3e - %.3e")
median = format_sigfig(3),
range = format_sigfig(3, "xx - xx")
)
)
```
Expand Down Expand Up @@ -94,5 +94,4 @@ result
```

{{< include ../../repro.qmd >}}

:::
12 changes: 6 additions & 6 deletions book/tables/pharmacokinetic/pkpt07.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ lyt <- basic_table() %>%
),
.formats = c(
n = "xx.",
mean = sprintf_format("%.3e"),
sd = sprintf_format("%.3e"),
mean = format_sigfig(3),
sd = format_sigfig(3),
cv = "xx.x",
median = sprintf_format("%.3e"),
geom_mean = sprintf_format("%.3e"),
median = format_sigfig(3),
geom_mean = format_sigfig(3),
geom_cv = "xx.x",
min = sprintf_format("%.3e"),
max = sprintf_format("%.3e")
min = format_sigfig(3),
max = format_sigfig(3)
)
)
```
Expand Down
10 changes: 5 additions & 5 deletions book/tables/pharmacokinetic/pkpt08.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ lyt <- basic_table() %>%
),
.formats = c(
n = "xx.",
mean = sprintf_format("%.3e"),
sd = sprintf_format("%.3e"),
mean = format_sigfig(3),
sd = format_sigfig(3),
cv = "xx.x",
median = sprintf_format("%.3e"),
min = sprintf_format("%.3e"),
max = sprintf_format("%.3e")
median = format_sigfig(3),
min = format_sigfig(3),
max = format_sigfig(3)
)
)
Expand Down
6 changes: 3 additions & 3 deletions book/tables/pharmacokinetic/pkpt11.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ s_gmr <- function(df,
afun_pk_gmr <- function(.formats = list(
n = "xx.",
geom_mean_ratio = sprintf_format("%.3e"),
gmr_ci_lwr = sprintf_format("%.3e"),
gmr_ci_upr = sprintf_format("%.3e")
geom_mean_ratio = format_sigfig(3),
gmr_ci_lwr = format_sigfig(3),
gmr_ci_upr = format_sigfig(3)
),
compare_dose = comp_dose,
denom = TRUE) {
Expand Down
34 changes: 17 additions & 17 deletions package/tests/testthat/_snaps/adat03/markdown-snaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
Protocol: A: Drug X Antibody
Analyte: R1800000
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Treatment Group
Visit Total Number Samples with
of Measurable Concentration
Samples {1} Mean SD Median Minimum Maximum CV (%) Geometric Mean ≤ 15μg/mL {2}
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
A: Drug X (N=536)
Day 1 402 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 NA NA 402 (100%)
Day 2 134 1.618e+01 1.626e+00 1.619e+01 1.260e+01 1.986e+01 10.0 1.610e+01 39 (29.1%)
C: Combination (N=792)
Day 1 528 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 NA NA 528 (100%)
Day 2 264 2.468e+01 8.645e+00 2.251e+01 1.264e+01 3.947e+01 35.0 2.315e+01 28 (10.6%)
Overall 1328 6.540e+00 1.095e+01 0.000e+00 0.000e+00 3.947e+01 167.5 NA 997 (75.1%)
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Treatment Group
Visit Total Number Samples with
of Measurable Concentration
Samples {1} Mean SD Median Minimum Maximum CV (%) Geometric Mean ≤ 15μg/mL {2}
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
A: Drug X (N=536)
Day 1 402 0 0 0 0 0 NA NA 402 (100%)
Day 2 134 16.2 1.63 16.2 12.6 19.9 10.0 16.1 39 (29.1%)
C: Combination (N=792)
Day 1 528 0 0 0 0 0 NA NA 528 (100%)
Day 2 264 24.7 8.65 22.5 12.6 39.5 35.0 23.2 28 (10.6%)
Overall 1328 6.54 11.0 0 0 39.5 167.5 NA 997 (75.1%)
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
{1} - Refers to the total no. of measurable ADA samples that have a corresponding measurable drug concentration sample (i.e. results with
valid numeric values and LTRs). LTR results on post-dose samples are replaced by aaa µg/mL i.e. half of MQC value.
{2} - In validation, the assay was able to detect yyy ng/mL of surrogate ADA in the presence of zzz µg/mL of [drug]. BLQ = Below Limit of
Quantitation, LTR = Lower than Reportable, MQC = Minimum Quantifiable Concentration, ADA = Anti-Drug Antibodies (is also referred to as ATA,
or Anti-Therapeutic Antibodies). RXXXXXXX is also known as [drug]
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

108 changes: 54 additions & 54 deletions package/tests/testthat/_snaps/pkpt02/markdown-snaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@
Analyte: Plasma Drug X
Visit: CYCLE 1 DAY 1
——————————————————————————————————————————————————————————————————————
PK Parameter ARM A ARM C
——————————————————————————————————————————————————————————————————————
Cmax (ug/mL)
n 134 132
Mean (SD) 3.025e+01 (6.239e+00) 3.004e+01 (5.457e+00)
CV (%) 20.6 18.2
Geometric Mean 2.961e+01 2.954e+01
CV % Geometric Mean 21.0 18.9
Median 2.986e+01 2.977e+01
Min - Max 1.753e+01 - 4.871e+01 1.585e+01 - 4.757e+01
AUCinf obs (day*ug/mL)
n 134 132
Mean (SD) 2.028e+02 (3.766e+01) 1.955e+02 (3.785e+01)
CV (%) 18.6 19.4
Geometric Mean 1.994e+02 1.917e+02
CV % Geometric Mean 18.7 20.1
Median 1.971e+02 1.962e+02
Min - Max 1.253e+02 - 3.110e+02 1.030e+02 - 3.145e+02
CL obs (ml/day/kg)
n 134 132
Mean (SD) 5.043e+00 (1.041e+00) 5.009e+00 (9.846e-01)
CV (%) 20.6 19.7
Geometric Mean 4.929e+00 4.907e+00
CV % Geometric Mean 22.4 21.1
Median 5.078e+00 4.969e+00
Min - Max 2.255e+00 - 7.395e+00 2.102e+00 - 7.489e+00
———————————————————————————————————————————————————
PK Parameter ARM A ARM C
———————————————————————————————————————————————————
Cmax (ug/mL)
n 134 132
Mean (SD) 30.2 (6.24) 30.0 (5.46)
CV (%) 20.6 18.2
Geometric Mean 29.6 29.5
CV % Geometric Mean 21.0 18.9
Median 29.9 29.8
Min - Max 17.5 - 48.7 15.9 - 47.6
AUCinf obs (day*ug/mL)
n 134 132
Mean (SD) 203 (37.7) 195 (37.8)
CV (%) 18.6 19.4
Geometric Mean 199 192
CV % Geometric Mean 18.7 20.1
Median 197 196
Min - Max 125 - 311 103 - 315
CL obs (ml/day/kg)
n 134 132
Mean (SD) 5.04 (1.04) 5.01 (0.985)
CV (%) 20.6 19.7
Geometric Mean 4.93 4.91
CV % Geometric Mean 22.4 21.1
Median 5.08 4.97
Min - Max 2.25 - 7.39 2.10 - 7.49

# result_v2

Expand All @@ -44,31 +44,31 @@
Analyte: Plasma Drug Y
Visit: CYCLE 1 DAY 1
——————————————————————————————————————————————
PK Parameter ARM C
——————————————————————————————————————————————
Cmax (ug/mL)
n 132
Mean (SD) 2.990e+01 (5.550e+00)
CV (%) 18.6
Geometric Mean 2.935e+01
CV % Geometric Mean 20.1
Median 2.969e+01
Min - Max 1.406e+01 - 4.345e+01
AUCinf obs (day*ug/mL)
n 132
Mean (SD) 1.986e+02 (3.792e+01)
CV (%) 19.1
Geometric Mean 1.952e+02
CV % Geometric Mean 18.9
Median 1.953e+02
Min - Max 1.264e+02 - 3.183e+02
CL obs (ml/day/kg)
n 132
Mean (SD) 4.955e+00 (8.951e-01)
CV (%) 18.1
Geometric Mean 4.873e+00
CV % Geometric Mean 18.7
Median 4.936e+00
Min - Max 2.987e+00 - 7.211e+00
—————————————————————————————————————
PK Parameter ARM C
—————————————————————————————————————
Cmax (ug/mL)
n 132
Mean (SD) 29.9 (5.55)
CV (%) 18.6
Geometric Mean 29.4
CV % Geometric Mean 20.1
Median 29.7
Min - Max 14.1 - 43.4
AUCinf obs (day*ug/mL)
n 132
Mean (SD) 199 (37.9)
CV (%) 19.1
Geometric Mean 195
CV % Geometric Mean 18.9
Median 195
Min - Max 126 - 318
CL obs (ml/day/kg)
n 132
Mean (SD) 4.96 (0.895)
CV (%) 18.1
Geometric Mean 4.87
CV % Geometric Mean 18.7
Median 4.94
Min - Max 2.99 - 7.21

Loading

0 comments on commit f0bf380

Please sign in to comment.