Hello! I’m following along the epiR handbook on regression. I’m at the gtsummary section and I was thinking if it was possible for the output to have 2 columns rather than just the total N column: a column for count (percent) of controls and another column for cases. This is similar to the output in the previous section (with columns for 1 and 0).

I tried piping it to the the group_by(outcome) as follows, but I get the following error: Error in UseMethod(“group_by”) : no applicable method for ‘group_by’ applied to an object of class “c(‘tbl_uvregression’, ‘gtsummary’)”

univ_tab ← linelist %>%

dplyr::select(explanatory_vars, outcome) %>% ## select variables of interesttbl_uvregression( ## produce univariate table

method = glm, ## define regression want to run (generalised linear model)

y = outcome, ## define outcome variable

method.args = list(family = binomial), ## define what type of glm want to run (logistic)

exponentiate = TRUE ## exponentiate to produce odds ratios (rather than log odds)

) %>%

group_by(outcome)