powered by
Function to return the summary table using gtsummary package
get_summary_gtsummary( the_data, selectvar, byvar = NULL, no_digits = 2, label = NULL )
the summary using gtsummarys tbl_summary option
a data frame
variables to be selected for summary
A column name (quoted or unquoted) in data.
no of digits to diaply, by default it is 2 Summary statistics will be calculated separately for each level of the by variable. If NULL, summary statistics are calculated using all observations.
List of formulas specifying variables labels,
trial <- gtsummary::trial table1 <- get_summary_gtsummary(trial, c("trt", "age", "grade"), byvar = "trt")
Run the code above in your browser using DataLab