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

Function to reverse the ordering/numbering of the grouping variables? #344

Open
ddsjoberg opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@ddsjoberg
Copy link
Collaborator

ddsjoberg commented Oct 2, 2024

This could be its own function or an argument in ard_strata()

For example, would it make more sense if these groups were reversed?

cards::ard_strata(cards::ADSL, .by = ARM, .f = ~ cards::ard_continuous(.x, by = SEX, variables = AGE))
#> {cards} data frame: 48 x 12
#>    group1 group1_level group2 group2_level variable stat_name stat_label   stat
#> 1     SEX            F    ARM      Placebo      AGE         N          N     53
#> 2     SEX            F    ARM      Placebo      AGE      mean       Mean 76.358
#> 3     SEX            F    ARM      Placebo      AGE        sd         SD  8.733
#> 4     SEX            F    ARM      Placebo      AGE    median     Median     78
#> 5     SEX            F    ARM      Placebo      AGE       p25         Q1     70
#> 6     SEX            F    ARM      Placebo      AGE       p75         Q3     84
#> 7     SEX            F    ARM      Placebo      AGE       min        Min     59
#> 8     SEX            F    ARM      Placebo      AGE       max        Max     89
#> 9     SEX            M    ARM      Placebo      AGE         N          N     33
#> 10    SEX            M    ARM      Placebo      AGE      mean       Mean 73.364
#> ℹ 38 more rows
#> ℹ Use `print(n = ...)` to see more rows
#> ℹ 4 more variables: context, fmt_fn, warning, error

Created on 2024-10-02 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant