predtools provides miscellaneous tools for developingand evaluating prediction models.
You can install the released version of predtools fromCRAN with:
install.packages("predtools")And the development version fromGitHub with:
# install.packages("remotes")remotes::install_github("resplab/predtools")The functioncalibration_plot takes observed andpredicted values from a prediction model and uses ggplot2 to produce acalibration plot:
library(predtools)library(dplyr)x <- rnorm(100, 10, 2)y <- x + rnorm(100,0, 1)data <- tibble(x,y)calibration_plot(data, obs = "x", pred_1 = "y")See vignettes for more advanced functionalities, includingmodel-basedROC,interceptadjustment,calibrationplot, andunitnormal loss integral in two dimensions.
You can also access the vignettes from R:
browseVignettes("predtools")