Description Usage Arguments Details Value Author(s) References Examples
Calibration plots for risk prediction models in for a binary endpoint
1 2 3 4 5 6 7  calPlot2(object, formula, data, splitMethod = "none", B = 1, M, showY,
method = "nne", round = TRUE, bandwidth = NULL, q = 10,
density = 55, add = FALSE, diag = !add, legend = !add, axes = !add,
xlim, ylim, xlab = "Predicted event probability",
ylab = "Observed proportion", col, lwd, lty, pch, cause = 1,
percent = TRUE, giveToModel = NULL, na.action = na.fail, cores = 1,
verbose = FALSE, ...)

object 
A named list of prediction models, where
allowed entries are (1) Robjects for which a
predictStatusProb method exists (see details), (2)
a 
formula 
A survival or event history formula. The
left hand side is used to compute the expected event
status. If 
data 
A data frame in which to validate the
prediction models and to fit the censoring model. If

splitMethod 
Defines the internal validation design:

B 
The number of crossvalidation steps. 
M 
The size of the subsamples for crossvalidation. 
showY 
If 
method 
The method for estimating the calibration curve(s):

round 
If 
bandwidth 
The bandwidth for 
q 
The number of quantiles for

density 
Gray scale for observations. 
add 
If 
diag 
If 
legend 
If 
axes 
If 
xlim 
Limits of xaxis. 
ylim 
Limits of yaxis. 
xlab 
Label for yaxis. 
ylab 
Label for xaxis. 
col 
Vector with colors, one for each element of
object. Passed to 
lwd 
Vector with line widths, one for each element
of object. Passed to 
lty 
lwd Vector with line style, one for each
element of object. Passed to 
pch 
Passed to 
cause 
For competing risks models, the cause of failure or event of interest 
percent 
If TRUE axes labels are multiplied by 100 and thus interpretable on a percent scale. 
giveToModel 
List of with exactly one entry for
each entry in 
na.action 
Passed to 
cores 
Number of cores for parallel computing.
Passed as the value of the argument 
verbose 
if 
... 
Used to control the subroutines: plot, axis,
lines, legend. See 
For method "nne" the optimal bandwidth with respect to is
obtained with the function dpik
from the
package KernSmooth
for a box kernel function.
list with elements: time, Frame and bandwidth (NULL for method quantile).
Thomas Alexander Gerds
TA Gerds, PA Andersen, and Kattan MW. Calibration plots for risk prediction models in the presence of competing risks. Statistics in Medicine, page to appear, 2014.
1 2 3 4 5 6 7 8 9 10 11  set.seed(40)
N=40
Y=rbinom(N,1,.5)
X1=rnorm(N)
X1[Y==1]=rnorm(sum(Y==1),mean=rbinom(sum(Y==1),1,.5))
X2=rnorm(N)
X2[Y==0]=rnorm(sum(Y==0),mean=rbinom(sum(Y==0),3,.5))
dat < data.frame(Y=Y,X1=X1,X2=X2)
lm1 < glm(Y~X1,data=dat,family="binomial")
lm2 < glm(Y~X2,data=dat,family="binomial")
calPlot2(list(lm1,lm2),data=dat)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.