Learn R Programming

gtsummary (version 0.1.0)

fmt_beta: Round and format regression model coefficients

Description

Takes in a vector of regression model coefficients, and returns a rounded and formatted coefficient vector. This is the default rounding for models formatted with fmt_regression(). Coefficients larger than 100 are rounded to the nearest integer, between 10 and 100 to one decimal place, and all others to 2 decimal places. These thresholds were selected with odds ratios and hazard ratios in mind.

Usage

fmt_beta(x)

Arguments

x

numeric vector

Examples

Run this code
# NOT RUN {
or <- c(100.2342, 11.234, 5.32423, 1.23423469, 0.234)
fmt_beta(or)
# }

Run the code above in your browser using DataLab