`Anova.mmrm` incompatibility with `broom::tidy()`
bug
**Summary**
Thank you for the `car::Anova()` method for `mmrm` models! We discovered a potential compatibility issue with this output and `broom::tidy()` that was surfaced via `cardx::ard_car_anova()`. It seems that the naming conventions used in the `Anova.mmrm()` method are not recognized by `broom::tidy()`:
```r
fit <- mmrm::mmrm(
formula = FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID),
data = mmrm::fev_data
)
car::Anova(fit) |>
broom::tidy()
```
results in:
```
mmrm() registered as car::Anova extension
# A tibble: 5 × 5
term Num.Df Denom.Df F.Statistic Pr...F.
<chr> <dbl> <dbl> <dbl> <dbl>
1 RACE 2 166. 36.9 5.54e-14
2 SEX 1 166. 0.376 5.41e- 1
3 ARMCD 1 169. 31.4 8.30e- 8
4 AVISIT 3 149. 143. 1.39e-43
5 ARMCD:AVISIT 3 148. 0.258 8.55e- 1
Warning message:
The column names Num.Df, Denom.Df, F.Statistic, and Pr...F. in ANOVA
output were not recognized or transformed.
```
I'm not sure if this issue belongs here or the `broom` package - please let me know if it should be the latter.
Thanks for your consideration!
**R session info**
<!--
Paste verbatim output from `R -e "utils::sessionInfo()"` below.
-->
```sh
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] vctrs_0.6.5 nlme_3.1-164 cli_3.6.3
[4] rlang_1.1.4 Formula_1.2-5 stringi_1.8.4
[7] purrr_1.1.0 car_3.1-3 generics_0.1.3
[10] glue_1.8.0 backports_1.5.0 TMB_1.9.16
[13] fansi_1.0.6 grid_4.4.1 abind_1.4-8
[16] carData_3.0-5 tibble_3.2.1 lifecycle_1.0.4
[19] stringr_1.5.2 compiler_4.4.1 dplyr_1.1.4
[22] Rcpp_1.0.13 pkgconfig_2.0.3 tidyr_1.3.1
[25] rstudioapi_0.16.0 lattice_0.22-6 mmrm_0.3.15
[28] R6_2.5.1 tidyselect_1.2.1 utf8_1.2.4
[31] pillar_1.9.0 Rdpack_2.6.2 rbibutils_2.3
[34] magrittr_2.0.3 checkmate_2.3.2 Matrix_1.7-0
[37] tools_4.4.1 broom_1.0.10
```
关闭于 2025-10-23 2 条评论