or_model_summary {basecamb} | R Documentation |
Summarise a logistic regression model on the odds ratio scale
Description
This function summarises regression models that return data on the log-odds
scale and returns a dataframe with estimates, and confidence intervals as
odds ratios. P value are also provided.
Additionally, intercepts can be removed from the summary. This comes in
handy when ordinal logistic regression models are fit. Ordinal regression
models (such as proportional odds models) usually result in many intercepts
that are not really of interest.
This function is also compatible with models obtained from multiply imputed
datasets, for example models fitted with Hmisc::fit.mult.impute()
.
Usage
or_model_summary(
model,
conf_int = 1.96,
print_intercept = FALSE,
round_est = 3,
round_p = 4
)
Arguments
model |
a model object with estimates on the log-odds scale. |
conf_int |
a numeric used to calculate the confidence intervals. The default of 1.96 gives the 95% confidence interval. |
print_intercept |
a logical flag indicating whether intercepts shall be removed. All variables that start with "y>=" will be removed. If there is a variable matching this pattern, it will also be removed! |
round_est |
the number of decimals returned for estimates (odds ratios) and confidence intervals. |
round_p |
the number of decimals provided for p-values. |
Details
CAVE! The function does not check whether your estimates are on the log-odds scale. It will do the transformation no matter what!
Value
a dataframe with the adjusted odds ratio, confidence intervals and p-values.
Author(s)
Till D. Best
Examples
# fit a logistic model
mod <- glm(formula = am ~ mpg + cyl, data = mtcars, family = binomial())
or_model_summary(model = mod)