View source: R/intCalibration.r
intCalibration | R Documentation |
For all the observations used a model fit, computes the estimated probability that Y is greater than each of a number of cutoffs, and compares this to smoothed estimated probabilities as a function of predicted probabilities, to obtain internal model calibration plots with multiple cutpoints. When Y is uncensored these are smoothed moving empirical cumulative distribution function estimates, and when Y has censored observations these are smoothing moving Kaplan-Meier estimates. Hmisc::movStats()
is used to do the moving overlapping window calculations. When hare=TRUE
, adaptive linear spline hazard regression estimates are also made, using polspline::hare()
.
intCalibration(
fit,
ycuts,
m,
x,
onlydata = FALSE,
eps = 25,
bass = 9,
tsmooth = "lowess",
hare = TRUE,
dec = 4,
xlab = bquote(hat(P)(.(yname) > y)),
ylab = "Nonparametric Estimate",
nrow = 1,
...
)
fit |
a fit object for which there is a |
ycuts |
a vector of cutpoints on Y |
m |
used when |
x |
a variable for which calibration-in-the-small is desired, instead of plotting predicted vs. observed probabilities. |
onlydata |
set to |
eps , bass , tsmooth , hare |
see |
dec |
number of digits to the right of the decimal place to which to round computed |
xlab |
x-axis label with default constructed from the Y-variable name in the model fit (y-axis label when |
ylab |
y-axis label |
nrow |
if |
... |
other arguments passed to |
These plots are plots of calibration-in-the-small. Alternate calibration-in-the-small plots may be obtained by specifying a predictor variable x
against which to plot both predicted and observed probabilties as a function of x
. This is the only place in the rms
package where the "total effect" of a predictor is estimated instead of a partial effect. When x
varies and moving overlapping windows of predicted and observed exceedance probabilities are estimated, if x
is collinear with other predictors, they will "come along for the ride".
The function also prints information on calibration-in-the-large, i.e., the mean predicted probability of being beyond each cutpoint vs. the overall proportion of observations above that cutpoint. This is when x
is not given.
ggplot2
object or a data frame
Frank Harrell
## Not run:
getHdata(nhgh)
f <- orm(gh ~ rcs(age, 4), data=nhgh, family='loglog', x=TRUE, y=TRUE)
intCalibration(f, ycuts=c(5, 5.5, 6, 6.5))
f <- update(f, family='cloglog')
intCalibration(f, ycuts=c(5, 5.5, 6, 6.5))
intCalibration(f, ycuts=c(5, 6, 7), x=nhgh$age)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.