I am so excited that my package OddsPlotty has landed on CRAN. This was a package I worked on when I was doing lots of multiple comparisons of logistic regression models and wanted a way to visualise the odds ratios on a graph i.e. an odds plot.
This package allows for the generation of odds plots and their associated Tibble outputs. It can be used with TidyModels and CARET machine learning models, as well as the core stats models of type glm.
The outputs are as below:
Elements of the chart:
- X axis is the odds ratio – this is the exponent of the log odds:
- Y axis are the independent variables (IVs)
- The dotted red line is the effect marker. Odds less 1 are considered to have no effect on the y^ (y hat) i.e. thing you are trying to predict.
- Error bars represent the odds ratio upper and lower confidence intervals (CI 95th). This shows the variability of the odds ratio estimate and can be used to assess the significance of a variable, alongside the summary table from the logistic regression model. Those error bars that converge or overlap the red dotted line, at the lower level, mean that there is too much variability to conclude that the metric is a statistically significant variable, or not.
- Blue numbers indicate the raw odds ratio values
Other examples genrated by the tool:
Does it work with TidyModels and CARET
The simple answer to this is yes.
Essentially, both packages use the glm driver package to make the estimations, so these can be combined to produce visualisation on the back of both of these object types.
This is explained in the supporting tutorial video.
How do I use this package?
I would have spent a couple of hours writing a post about this, but instead I have made a video instead:
Getting this on to CRAN has been a labour of love and marks the 3rd package I have managed to get uploaded, with many more sitting on GitHub.
It has been great finally getting this to CRAN and please use it.