# NOT RUN {
# Example 1 --------------------------------
# Add number of cases and controls to regression table
modify_table_body_ex1 <-
trial %>%
select(response, age, marker) %>%
tbl_uvregression(y = response,
method = glm,
method.args = list(family = binomial),
exponentiate = TRUE,
hide_n = TRUE) %>%
add_nevent() %>%
# adding number of non-events to table
modify_table_body(dplyr::mutate, n_nonevent = N - nevent) %>%
# move new column to before the nevent column
modify_table_body(dplyr::relocate, n_nonevent, .before = nevent) %>%
modify_header(n_nonevent = "**Control N**", nevent = "**Case N**")
# }
Run the code above in your browser using DataLab