fmt_uni_regression.Rd
The fmt_uni_regression
function arguments are similar to the fmt_regression
arguments. Review the fmt_uni_regression
vignette for detailed examples.
fmt_uni_regression(data, method, y, method.args = NULL, formula = "{y} ~ {.x}", exponentiate = FALSE, label = NULL, show_yesno = NULL, conf.level = 0.95, beta_fun = fmt_beta, pvalue_fun = fmt_pvalue)
data | Data frame to be used in univariate regression modeling. Data frame includes the outcome variable(s) and the independent variables. |
---|---|
method | |
y | model outcome as a string (e.g. |
method.args | List of additional arguments passed on to the regression function defined by method. |
formula | String that becomes the model formula. Uses |
exponentiate | logical argument passed directly to |
label | list of labels to write in the output. |
show_yesno | Vector of names of categorical and factor variables that
are |
conf.level | confidence level passed directly to |
beta_fun | function to round and format beta coefficients. Default is |
pvalue_fun | function to round and format p-values. Default is |
fmt_uni_regression( trial, method = "glm", y = "response", method.args = list(family = binomial), exponentiate = TRUE )#> #> Variable N OR 95% CI p-value #> Treatment Randomization 191 #> Drug Ref. #> Placebo 0.47 0.26, 0.84 0.012 #> Age, yrs 183 1.00 0.98, 1.02 >0.9 #> Marker Level, ng/mL 183 0.92 0.65, 1.30 0.6 #> T Stage 191 #> T1 Ref. #> T2 1.40 0.63, 3.14 0.4 #> T3 0.63 0.26, 1.50 0.3 #> T4 0.50 0.22, 1.11 0.089 #> Grade 191 #> I Ref. #> II 0.60 0.29, 1.25 0.2 #> III 0.76 0.38, 1.51 0.4# rounding pvalues to 2 decimal places, and adding global p-values fmt_uni_regression( trial, method = "glm", y = "response", method.args = list(family = binomial), exponentiate = TRUE, pvalue_fun = function(x) fmt_pvalue(x, digits = 2) ) %>% add_global()#> #> Variable N OR 95% CI p-value #> Treatment Randomization 191 0.011 #> Drug Ref. #> Placebo 0.47 0.26, 0.84 #> Age, yrs 183 1.00 0.98, 1.02 0.90 #> Marker Level, ng/mL 183 0.92 0.65, 1.30 0.64 #> T Stage 191 0.055 #> T1 Ref. #> T2 1.40 0.63, 3.14 #> T3 0.63 0.26, 1.50 #> T4 0.50 0.22, 1.11 #> Grade 191 0.40 #> I Ref. #> II 0.60 0.29, 1.25 #> III 0.76 0.38, 1.51