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

Should we change the ordering of the grouping variables? #366

Open
ddsjoberg opened this issue Dec 18, 2024 · 0 comments
Open

Should we change the ordering of the grouping variables? #366

ddsjoberg opened this issue Dec 18, 2024 · 0 comments

Comments

@ddsjoberg
Copy link
Collaborator

ddsjoberg commented Dec 18, 2024

In the example below, the group1 is the outermost variable, but really should be next to variable.

But in the hierarchical ARD, we'd need to figure out the ordering....

library(cards)

ard_strata(
  ADSL,
  .by = AGEGR1,
  .f = ~ cardx::ard_stats_kruskal_test(.x, by = ARM, variables = AGE)
)
#> {cards} data frame: 12 x 11
#>    group1 group2 group2_level variable stat_name stat_label      stat
#> 1     ARM AGEGR1          <65      AGE statistic  Kruskal-…     7.381
#> 2     ARM AGEGR1          <65      AGE   p.value    p-value     0.025
#> 3     ARM AGEGR1          <65      AGE parameter  Degrees …         2
#> 4     ARM AGEGR1          <65      AGE    method     method Kruskal-…
#> 5     ARM AGEGR1          >80      AGE statistic  Kruskal-…     0.938
#> 6     ARM AGEGR1          >80      AGE   p.value    p-value     0.626
#> 7     ARM AGEGR1          >80      AGE parameter  Degrees …         2
#> 8     ARM AGEGR1          >80      AGE    method     method Kruskal-…
#> 9     ARM AGEGR1        65-80      AGE statistic  Kruskal-…     1.146
#> 10    ARM AGEGR1        65-80      AGE   p.value    p-value     0.564
#> 11    ARM AGEGR1        65-80      AGE parameter  Degrees …         2
#> 12    ARM AGEGR1        65-80      AGE    method     method Kruskal-…
#> ℹ 4 more variables: context, fmt_fn, warning, error

Created on 2024-12-18 with reprex v2.1.1

@ddsjoberg ddsjoberg added this to the Release v0.4.0 milestone Dec 18, 2024
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