2

I have run a few models in for the penalized logistic model in R using the logistf package. I however wish to plot some forest plots for the data.

The sjPlot package : http://www.strengejacke.de/sjPlot/custplot/

gives excellent function for the glm output, but no function for the logistf function.

Any assistance?

MichaelChirico
  • 33,841
  • 14
  • 113
  • 198
Edwin
  • 35
  • 5

1 Answers1

3

The logistf objects differ in their structure compared to glm objects, but not too much. I've added support for logistf-fitted models, however, 1) model summaries can't be printed and b) predicted probability plots are currently not supported with logistf-models.

I'll update the code on GitHub tonight, so you can try the updated sjp.glm function...

library(sjPlot)
library(logistf)
data(sex2)
fit<-logistf(case ~ age+oc+vic+vicl+vis+dia, data=sex2)
# for this example, axisLimits need to be specified manually
sjp.glm(fit, axisLimits = c(0.05, 25), transformTicks = T)

enter image description here

Daniel
  • 7,252
  • 6
  • 26
  • 38
  • btw, you have to set axis limits from 0.001 to 4000 to plot all CI, I just realized... `sjp.glm(fit, axisLimits = c(0.001, 4000), transformTicks = T)` plots all odds ratios and confidence intervals for the above example. – Daniel Mar 12 '15 at 16:20