Check Parallelism Assumption of Ordinal Semiparametric Models
Source:R/intCalibration.r
intCalibration.RdFor 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(). When ordsurv=TRUE, adaptive ordinal regression estimates are made in addition.
Arguments
- fit
a fit object for which there is a
survest()method, withx=TRUE, y=TRUEin effect- ycuts
a vector of cutpoints on Y
- m
used when
ycutsis not given. The lowest cutoff is chosen as the first Y value having at meastmuncensored observations to its left, and the highest cutoff is chosen so that there are at leastmuncensored observations to the right of it. Cutoffs are equally spaced between these values in terms of number of uncensored observations. If omitted,mis set to the minimum of 50 and one quarter of the uncensored sample size.- x
a variable for which calibration-in-the-small is desired, instead of plotting predicted vs. observed probabilities.
xwill typically be chosen by virtue of being a strong predictor (such that lack of fit will matter more) but doesn't have to be in the model.- onlydata
set to
TRUEto return a data frame suitable for plotting instead of actually plotting- eps, bass, tsmooth, hare, ordsurv
- dec
number of digits to the right of the decimal place to which to round computed
ycuts- xlab
x-axis label with default constructed from the Y-variable name in the model fit (y-axis label when
xis specified)- ylab
y-axis label
- nrow
if
hare=TRUEorordsurv=TRUE, the number of rows in the graph (must be 1 or 2)- ...
other arguments passed to
Hmisc::movStats(). To control the number of knots forordsurv=TRUEspecifyk=here.
Details
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.