-
Notifications
You must be signed in to change notification settings - Fork 131
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
Feature request: option to pass vcov to add_global_p(anova_fun = tidy_wald_test)
for robust p-values
#2076
Comments
Added in #2077 |
Hey @aghaynes ! Thanks again for the contribution to make to make it easier for robust standard errors! Would you be open to another contribution? I think an example in our FAQ article illustrating how to use robust standard errors using What do you think? |
Hey @ddsjoberg! Great idea. I'll have a look. Maybe there's a suitable dataset in |
Awesome, thank you! If {aod} doesn't have something, I sometimes use this as an example for correlated data gtsummary::trial |>
dplyr::mutate(subject_id = dplyr::row_number(), .by = trt)
#> # A tibble: 200 × 9
#> trt age marker stage grade response death ttdeath subject_id
#> <chr> <dbl> <dbl> <fct> <fct> <int> <int> <dbl> <int>
#> 1 Drug A 23 0.16 T1 II 0 0 24 1
#> 2 Drug B 9 1.11 T2 I 1 0 24 1
#> 3 Drug A 31 0.277 T1 II 0 0 24 2
#> 4 Drug A NA 2.07 T3 III 1 1 17.6 3
#> 5 Drug A 51 2.77 T4 III 1 1 16.4 4
#> 6 Drug B 39 0.613 T4 I 0 1 15.6 2
#> 7 Drug A 37 0.354 T1 II 0 0 24 5
#> 8 Drug A 32 1.74 T1 I 0 1 18.4 6
#> 9 Drug A 31 0.144 T1 II 0 0 24 7
#> 10 Drug B 34 0.205 T3 I 0 1 10.5 3
#> # ℹ 190 more rows Created on 2024-12-02 with reprex v2.1.1 which gives us a data set where each subject received both Drug A and Drug B (there |
Is your feature request related to a problem? Please describe.
When adjusting variances via e.g. clustered variances, it's possible to adjust the confidence interval, but not the p-value.
Describe the solution you'd like
It would be great to be able to pass a vcov to (e.g.
cov
in the above code) totidy_wald_test
so thataod::wald.test
can also use it.e.g.
Describe alternatives you've considered
@mroumet and I managed to backwards engineer a solution that takes a
cov
object from the global environment. Maybe it's possible to pass it as an option instead though. I indicate the modification we made with an arrow.I've just found that the proposed edits (passing it via an option) are very easy and seem to work... I'll make a PR shortly.
Additional context
MRE using a example data from the sandwich package
The text was updated successfully, but these errors were encountered: