Hello,
I am using the survey weights as suggested here forum discussion. However, I can not use this survey design to create the descriptive statistics table use tbl_svysummary
function in the gtsummary
package. It keeps giving me this warning:
And my tbl_svysummary
codes are like this:
df_descriptive <- df %>%
tbl_svysummary(
by = group,
missing = "ifany",
include = c(age, sex, race, marital,
hispanic, citizen, education,
region, rurality, poverty),
type = all_dichotomous() ~ "categorical",
statistic = list(all_continuous() ~ "{median} ({p25}, {p75})",
all_categorical() ~ "{n} ({p}%)"),
digits = list(all_categorical() ~ c(0, 2))) %>%
add_overall()
Does anyone know what is wrong here? Or, Is there any other way to create the descriptive table efficiently?
Thanks so much!!