Creates nomogram (alignment chart) plots for clinical prediction models. Accepts a fitted regression model (glm, coxph) or an rms nomogram object, and draws the points-to-probability mapping chart.
Usage
NomogramPlot(
model,
fun = NULL,
fun.at = NULL,
lp = TRUE,
funlabel = "Probability",
maxscale = 100,
line_color = "black",
tick_color = "black",
text_size = 3.5,
theme = "theme_ggforge",
theme_args = list(),
palette = "forge",
palcolor = NULL,
title = NULL,
subtitle = NULL,
...
)Arguments
- model
A fitted model object (glm, coxph) or an rms::nomogram object.
- fun
Prediction function(s) for outcome probabilities (passed to rms::nomogram). Ignored if model is already a nomogram object.
- fun.at
Specific probability values to mark on the axis.
- lp
Whether to show linear predictor axis.
- funlabel
Label(s) for the function axis.
- maxscale
Maximum points scale.
- line_color
Color for axis lines.
- tick_color
Color for tick marks.
- text_size
Size for axis text.
- theme
Theme name (string) or theme function
- theme_args
List of arguments passed to theme function
- palette
Color palette name
- palcolor
Custom colors for palette
- title
Plot title
- subtitle
Plot subtitle
- ...
Additional arguments passed to rms::nomogram or plotting.
See also
Other clinical-prediction-plots:
CalibrationPlot(),
DecisionCurvePlot()
Examples
# \donttest{
# Requires rms package
if (requireNamespace("rms", quietly = TRUE)) {
library(rms)
dd <- datadist(iris)
options(datadist = "dd")
fit <- lrm(Species == "setosa" ~ Sepal.Length + Sepal.Width, data = iris)
NomogramPlot(fit, fun = plogis)
}
#> Loading required package: Hmisc
#>
#> Attaching package: ‘Hmisc’
#> The following objects are masked from ‘package:base’:
#>
#> format.pval, units
#> Error in Design(data, formula = formula): dataset dd not found for options(datadist=)
# }
