# NOT RUN {
tbl_uv_ex1 <-
tbl_uvregression(
trial %>% dplyr::select(response, age, grade),
method = glm,
y = response,
method.args = list(family = binomial),
exponentiate = TRUE
)
# rounding pvalues to 2 decimal places
library(survival)
tbl_uv_ex2 <-
tbl_uvregression(
trial %>% dplyr::select(ttdeath, death, age, grade, response),
method = coxph,
y = Surv(ttdeath, death),
label = list(vars(grade) ~ "Grade"),
exponentiate = TRUE,
pvalue_fun = function(x) style_pvalue(x, digits = 2)
)
# }
Run the code above in your browser using DataLab