Authors: Sebastian Gibb [aut, cre], Paul Ahrens [aut, dtc], Daniel Steinbach [aut, dtc], Maria Schmidt [aut, dtc], Thorsten Kaiser [aut, dtc], Mark Wernsdorfer [dtc], Matthias Nauck [dtc], Stefan Bollmann [dtc], Thomas Hildebrandt [dtc]
Last modified: 2024-03-07 08:43:33.649335
Compiled: Thu Mar 7 08:46:12 2024

sbcdata <- sbc_exclude_entries(sbcdata)
sbcdata <- sbcdata[(!Excluded),]

.lbl <- function(x, unit) {
    if (nchar(unit))
        paste0(x, " [", unit, "]")
     else
        x
}

for (i in seq_len(nrow(labcodes))) {
    attr(sbcdata[[labcodes$Code[i]]], "label") <-
        .lbl(labcodes$Code[i], labcodes$Unit[i])
}

Baseline Leipzig

## Setting theme `New England Journal of Medicine`
## Setting theme `Compact`
ukl <- subset(sbcdata, Center == "Leipzig")

tblGeneral <- ukl[!duplicated(ukl$Id),] |>
    select(Age, Sex, Diagnosis) |>
    tbl_summary(by = Diagnosis, missing_text = "(Missing)") |>
    add_p()

tblLabs <- ukl[, c("Diagnosis", labcodes$Code), with = FALSE] |>
    tbl_summary(by = Diagnosis, missing_text = "(Missing)") |>
    add_p()

tbl_stack(
    list(add_n(tblGeneral), add_n(tblLabs)),
    group_header = c("General", "Laboratory Diagnostics")
)
##  Column headers among stacked tables differ. Headers from the first table are
## used. Use `quiet = TRUE` to suppress this message.
Characteristic N Control, N = 705,7101 Sepsis, N = 2,8851 p-value2
General
Age 708,595 57 (39 – 71) 67 (58 – 77)
Sex 708,595

    M
337,562 (48) 1,847 (64)
    W
368,148 (52) 1,038 (36)
Laboratory Diagnostics
CRP [mg/l] 955,616 8 (2 – 32) 57 (18 – 139)
    (Missing)
420,089 5,653
HGB [mmol/l] 1,381,358 7.80 (6.50 – 8.70) 5.40 (4.80 – 6.40)
MCV [fl] 1,381,358 87.9 (84.6 – 91.5) 86.8 (82.9 – 91.6)
PCT [ng/ml] 35,687 0.12 (0.07 – 0.32) 1.07 (0.34 – 4.76)
    (Missing)
1,330,724 14,947
PLT [Gpt/l] 1,381,358 236 (181 – 297) 70 (26 – 191)
RBC [Tpt/l] 1,381,358 4.20 (3.56 – 4.68) 2.93 (2.59 – 3.50)
WBC [Gpt/l] 1,381,358 7.4 (5.6 – 9.7) 4.9 (0.9 – 10.9)
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test

Greifswald vs Leipzig

tblGeneral <- sbcdata[
    !duplicated(sbcdata[,c("Id", "Center"), with = FALSE]),
] |>
    select(Age, Sex, Diagnosis, Center) |>
    tbl_summary(by = Center, missing_text = "(Missing)") |>
    add_p()

tblLabs <- sbcdata[, c("Center", labcodes$Code), with = FALSE] |>
    tbl_summary(by = Center, missing_text = "(Missing)") |>
    add_p()

tbl_stack(
    list(add_n(tblGeneral), add_n(tblLabs)),
    group_header = c("General", "Laboratory Diagnostics")
)
##  Column headers among stacked tables differ. Headers from the first table are
## used. Use `quiet = TRUE` to suppress this message.
Characteristic N Greifswald, N = 157,9221 Leipzig, N = 708,5951 p-value2
General
Age 866,517 63 (50 – 76) 57 (39 – 71)
Sex 866,517

    M
79,039 (50) 339,409 (48)
    W
78,883 (50) 369,186 (52)
Diagnosis 866,517

0.010
    Control
157,206 (100) 705,710 (100)
    Sepsis
716 (0.5) 2,885 (0.4)
Laboratory Diagnostics
CRP [mg/l] 1,160,718 26 (10 – 72) 8 (2 – 33)
    (Missing)
232,975 425,742
HGB [mmol/l] 1,819,435 7.50 (6.20 – 8.50) 7.70 (6.50 – 8.60)
MCV [fl] 1,819,435 90.3 (86.8 – 94.1) 87.9 (84.5 – 91.5)
PCT [ng/ml] 45,234 0.21 (0.09 – 0.63) 0.13 (0.07 – 0.37)
    (Missing)
428,530 1,345,671
PLT [Gpt/l] 1,819,435 225 (173 – 285) 236 (179 – 296)
RBC [Tpt/l] 1,819,435 4.10 (3.40 – 4.60) 4.19 (3.54 – 4.67)
WBC [Gpt/l] 1,819,435 8.1 (6.2 – 10.7) 7.4 (5.5 – 9.7)
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test

Leipzig PCT

pct <- ukl[sbcdata:::.is_cbc(ukl, labcodes$Code[-1], complete = TRUE), ]
tblGeneral <- pct[!duplicated(pct$Id),] |>
    select(Age, Sex, Diagnosis) |>
    tbl_summary(by = Diagnosis, missing_text = "(Missing)") |>
    add_p()

tblLabs <- pct[, c("Diagnosis", labcodes$Code), with = FALSE] |>
    tbl_summary(by = Diagnosis, missing_text = "(Missing)") |>
    add_p()

tbl_stack(
    list(add_n(tblGeneral), add_n(tblLabs)),
    group_header = c("General", "Laboratory Diagnostics")
)
##  Column headers among stacked tables differ. Headers from the first table are
## used. Use `quiet = TRUE` to suppress this message.
Characteristic N Control, N = 24,7731 Sepsis, N = 1,1121 p-value2
General
Age 25,885 62 (52 – 71) 66 (56 – 76)
Sex 25,885

0.003
    M
14,882 (60) 717 (64)
    W
9,891 (40) 395 (36)
Laboratory Diagnostics
CRP [mg/l] 34,354 34 (6 – 114) 131 (51 – 244)
    (Missing)
1,291 42
HGB [mmol/l] 35,687 7.20 (6.00 – 8.20) 6.00 (5.00 – 7.50)
MCV [fl] 35,687 87 (83 – 91) 87 (83 – 92) 0.068
PCT [ng/ml] 35,687 0.12 (0.07 – 0.32) 1.07 (0.34 – 4.76)
PLT [Gpt/l] 35,687 221 (153 – 310) 165 (52 – 272)
RBC [Tpt/l] 35,687 3.96 (3.33 – 4.54) 3.28 (2.74 – 4.10)
WBC [Gpt/l] 35,687 7.6 (5.3 – 11.2) 10.4 (4.0 – 17.1)
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test