Here is the code that I am using to output a anova summary table with:
hiv %>%
select(education, sexfirsttime) %>%
mutate(education=
factor(education, levels= c("no education", "primary","secondary","college"))) %>%
tbl_summary(missing="no",
by=education,
statistic = all_continuous() ~"{mean} ({sd})",
label = sexfirsttime ~ "Age of first time sex") %>%
add_p(test= all_continuous() ~ "aov") %>%
modify_header(statistic ~ "**Test Statistic**")
After executing the code, I get the following error message:
Error: Error in update= argument input. Select from ‘variable’, ‘test_name’, ‘var_type’, ‘var_label’, ‘row_type’, ‘label’, ‘stat_1’, ‘stat_2’, ‘stat_3’, ‘stat_4’, ‘test_result’, ‘p.value’
When I try replacing statistic in modify_header with test_result, the output that I get a bizarre output as shown is in the image.
I am fairly new to using gtsummary. Any help would be greatly appreciated. Thank you.
