-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add add_stat_label()
to the JAMA theme for tbl_svysummary()
output
#1964
Comments
Dear @jaromilfrossard , Thanks for the post. Can you make a couple of updates/add more information?
|
Hello, The difference is in the display of the statistics. From my understanding the JAMA theme displays the statistics with the variable name (eg: "Class, n (%)") not as reference in the footnote. However, this feature does not seem to apply with tbl_svysummary(). It is visible in the last kable, the "quoted" line is "|Class |NA |NA |", but I would expect "|Class, n (%) |NA |NA |". I hope it is more clear now. library(gtsummary)
#> Warning: package 'gtsummary' was built under R version 4.4.1
reset_gtsummary_theme()
# default theme
survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) |>
tbl_svysummary(by = Survived, percent = "row", include = c(Class, Age)) |>
knitr::kable() |Characteristic |No as.data.frame(Titanic)|>
tbl_summary(by = Survived, percent = "row", include = c(Class, Age)) |>
knitr::kable() |Characteristic |No theme_gtsummary_journal("jama")
#> Setting theme "JAMA"
# Here it displays the statistics with the variable: "Class, n (%)"
as.data.frame(Titanic)|>
tbl_summary(by = Survived, percent = "row", include = c(Class, Age)) |>
knitr::kable() |Characteristic |No # Here the statistic is not displayed: "Class, n (%)"
survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) |>
tbl_svysummary(by = Survived, percent = "row", include = c(Class, Age)) |>
knitr::kable() |Characteristic |No
|1st |122 (38) |203 (62) | Created on 2024-09-13 with reprex v2.1.1 |
Ah, yes, I see now. Thank you for the report! |
add_stat_label()
to the JAMA theme for tbl_svysummary()
output
Hello,
Thank you for creating gtsummary!
It seems that the theme for journals does not apply correctly to the tbl_svysummary() object as it stays the default.
However, it seems that the "compact" theme worked as I expected.
I am using the last CRAN version of gtsummary (2.0.2), with R 4.4.0, on windows.
Thanks you again!
PROBLEM: default theme
OK : JAMA theme
PROBLEM: default + compact theme
OK: JAMA + compact theme
The text was updated successfully, but these errors were encountered: