Background/aim
I am using gtsummary to present tables that also include statistical tests performed by the package. I want to supplement the table with additional information about the statistical test in my manuscript text. For example, gtsummary has tested mean differences between groups with anova and I want to report the F value and degrees of value of the test in the text. Is there any way to extract this information from the gtsummary object or do I have to run the statistical tests again separately and extract it from there? I.e., run a aov() and copy paste from output?
Example situation with anova as the statistical test
library(tidyverse)
library(gtsummary)
theme_gtsummary_mean_sd()
gtTable <- mtcars %>%
select(cyl, mpg) %>%
tbl_summary(by = cyl) %>%
add_p()
oneWay <- aov(mpg ~ cyl, data = mtcars)
summary(oneWay)
#> Df Sum Sq Mean Sq F value Pr(>F)
#> cyl 1 817.7 817.7 79.56 6.11e-10 ***
#> Residuals 30 308.3 10.3
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
