I have a model that I calibrated using a logistic regression. I plotted the data using the calibration.plot from the gbm package. Now that I am submitting the paper for publication, the publisher requested the figures to be black and white, and therefore I need to change the line types. However, passing lty to the line.par argument doesn't do anything. Is there any other suggestion?
Example code:
library(gbm)
set.seed(123)
data <- data.frame(y = sample(c(0,1), size = 100, replace = TRUE),
pred = runif(100, min = 0, max = 1))
calibrate.plot(data$y, data$pred,
distribution = 'bernouli',
replace = TRUE,
shade.col = NA,
line.par = list(col ="black", lty= 2))
Unfortunately the red line is hard-coded in the function.
If you type
calibrate.plotinto your console, you will see that the last line isSo there are no parameters that can be passed into the function to make it draw anything other than a red line.
However, the other thing that is obvious from looking at the code is what it does. It fits a binomial glm using natural cubic splines, gets the predictions along the range of the predictors and plots these, along with a rug plot and an abline.
The following code is therefore completely equivalent:
We can see this gives us a black-and-white equivalent of
calibrate.plot