Closed ddsjoberg closed 3 months ago
FYI @statasaurus
Ahh, I mis-read the docs. Nothing wrong at all with the .overall
argument. When there is a by
argument AND .overall = TRUE
, then we get the results re-calculated with by=NULL
(essentially, we can add a new column call Overall to our table with all treatment groups combined. This is exactly what is happening, and what we want
I think the misunderstanding is regarding this chunk that executes when there is a by
variable present. We want not just the total N, but the other summary stats for the by group as well. In the case of a univariate tabulation, N
is the same for every level of the by
variable.
ard_categorical(
data = data,
variables = all_of(by),
statistic = everything() ~ categorical_summary_fns("N")
)
Created on 2024-04-02 with reprex v2.1.0