calibrate(rms)
calibrate()所属R语言包:rms
Resampling Model Calibration
重采样模型校准
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Uses bootstrapping or cross-validation to get bias-corrected (overfitting- corrected) estimates of predicted vs. observed values based on subsetting predictions into intervals (for survival models) or on nonparametric smoothers (for other models). There are calibration functions for Cox (cph), parametric survival models (psm), binary and ordinal logistic models (lrm) and ordinary least squares (ols). For survival models, "predicted" means predicted survival probability at a single time point, and "observed" refers to the corresponding Kaplan-Meier survival estimate, stratifying on intervals of predicted survival, or, if the polspline package is installed, the predicted survival probability as a function of transformed predicted survival probability using the flexible hazard regression approach (see the val.surv function for details). For logistic and linear models, a nonparametric calibration curve is estimated over a sequence of predicted values. The fit must have specified x=TRUE, y=TRUE. The print and plot methods for lrm and ols models (which use calibrate.default) print the mean absolute error in predictions, the mean squared error, and the 0.9 quantile of the absolute error. Here, error refers to the difference between the predicted values and the corresponding bias-corrected calibrated values.
使用自举或交叉验证偏置校正(过度拟合校正)子集的基础上预测的时间间隔(生存模式)或(其他型号)的非参数平滑的预测值与观测值的估计。有校准功能考克斯(cph),参数生存模型(psm),二进制和有序Logistic模型(lrm)和普通最小二乘法(ols)。为了生存模式,“预测”是指预计在一个单一的时间点的生存概率,和“观察”是指到相应的Kaplan-Meier生存估计,分层预测生存的间隔,或者,如果polspline包安装完毕后,预计生存概率转化的预测生存概率,使用灵活的风险回归方法,看看val.surv功能的详细信息,作为一个功能。对于后勤和线性模型,非参数校准曲线估计一个序列的预测值。必须指定的契合x=TRUE, y=TRUE。 print和plot方法lrm和ols模型(使用calibrate.default)打印在预测的平均绝对误差,均方误差,和0.9分位数的绝对误差。这里,误差是指预测值和相应的偏置校正的校准值之间的差异。
Below, the second, third, and fourth invocations of calibrate are, respectively, for ols and lrm, cph, and psm. The first and second plot invocation are respectively for lrm and ols fits or all other fits.
下面,第二,第三,和第四调用calibrate的是,分别为ols和lrm,cph,和psm。第一和第二plot调用分别为lrm和ols适合或其他适合的。
用法----------Usage----------
calibrate(fit, ...)
## Default S3 method:[默认方法]
calibrate(fit, predy,
method=c("boot","crossvalidation",".632","randomization"),
B=40, bw=FALSE, rule=c("aic","p"),
type=c("residual","individual"),
sls=.05, aics=0, force=NULL, pr=FALSE, kint, smoother="lowess",
digits=NULL, ...)
## S3 method for class 'cph'
calibrate(fit, cmethod=c('hare', 'KM'),
method="boot", u, m=150, pred, cuts, B=40,
bw=FALSE, rule="aic", type="residual", sls=0.05, aics=0, force=NULL,
pr=FALSE, what="observed-predicted", tol=1e-12, maxdim=5, ...)
## S3 method for class 'psm'
calibrate(fit, cmethod=c('hare', 'KM'),
method="boot", u, m=150, pred, cuts, B=40,
bw=FALSE,rule="aic",
type="residual", sls=.05, aics=0, force=NULL,
pr=FALSE, what="observed-predicted", tol=1e-12, maxiter=15,
rel.tolerance=1e-5, maxdim=5, ...)
## S3 method for class 'calibrate'
print(x, B=Inf, ...)
## S3 method for class 'calibrate.default'
print(x, B=Inf, ...)
## S3 method for class 'calibrate'
plot(x, xlab, ylab, subtitles=TRUE, conf.int=TRUE,
cex.subtitles=.75, riskdist=TRUE, add=FALSE,
scat1d.opts=list(nhistSpike=200), ...)
## S3 method for class 'calibrate.default'
plot(x, xlab, ylab, xlim, ylim,
legend=TRUE, subtitles=TRUE, scat1d.opts=NULL, ...)
参数----------Arguments----------
参数:fit
a fit from ols, lrm, cph or psm
从ols,lrm,cph或psm一个合适的
参数:x
an object created by calibrate
对象创建的calibrate
参数:method, B, bw, rule, type, sls, aics, force
see validate. For print.calibrate, B is an upper limit on the number of resamples for which information is printed about which variables were selected in each model re-fit. Specify zero to suppress printing. Default is to print all re-samples.
看到validate。对于print.calibrate,B是一个信息的变量选择的每个模型中再适合打印的重新采样的数量上限。指定零压制打印。默认情况下是打印所有样本。
参数:cmethod
method for validating survival predictions using right-censored data. The default is cmethod='hare' to use the hare function in the polspline package. Specify cmethod='KM' to use less precision stratified Kaplan-Meier estimates. If the polspline package is not available, the procedure reverts to cmethod='KM'.
使用右删失数据的验证生存的预测方法。默认值是cmethod='hare'使用hare功能,在polspline包。指定cmethod='KM'使用精度较低分层的Kaplan-Meier估计值。如果polspline包不可用,程序恢复到cmethod='KM'。
参数:u
the time point for which to validate predictions for survival models. For cph fits, you must have specified surv=TRUE, time.inc=u, where u is the constant specifying the time to predict.
验证预测生存模型的时间点。 cph千篇一律,你必须指定surv=TRUE, time.inc=u,u是常数,指定的时间预测。
参数:m
group predicted u-time units survival into intervals containing m subjects on the average (for survival models only)
组预测u时间单位为间隔的生存模式包含m科目平均(生存)
参数:pred
vector of predicted survival probabilities at which to evaluate the calibration curve. By default, the low and high prediction values from datadist are used, which for large sample size is the 10th smallest to the 10th largest predicted probability.
矢量预测的生存概率在评估校准曲线。默认情况下,低和高的预测值从datadist使用,这对于大样本量最小的是第10到第10大预测概率。
参数:cuts
actual cut points for predicted survival probabilities. You may specify only one of m and cuts (for survival models only)
实际切点预测的生存概率。您可以指定只有一个m和cuts(生存模式)
参数:pr
set to TRUE to print intermediate results for each re-sample
设置为TRUE打印每一个重样的中间结果
参数:what
The default is "observed-predicted", meaning to estimate optimism in this difference. This is preferred as it accounts for skewed distributions of predicted probabilities in outer intervals. You can also specify "observed". This argument applies to survival models only.
默认值是"observed-predicted",意思是乐观的估计这种差异。这是首选,因为它占偏斜分布的预测概率外的时间间隔。您也可以指定"observed"。此参数只适用于生存模式。
参数:tol
criterion for matrix singularity (default is 1e-12)
矩阵奇异的标准(默认是1e-12)
参数:maxdim
see hare
看到hare
参数:maxiter
for psm, this is passed to survreg.control (default is 15 iterations)
psm,这是传递给survreg.control(默认是15次迭代)
参数:rel.tolerance
parameter passed to survreg.control for psm (default is 1e-5).
参数传递survreg.controlpsm(默认是1e-5)。
参数:predy
a scalar or vector of predicted values to calibrate (for lrm, ols). Default is 50 equally spaced points between the 5th smallest and the 5th largest predicted values. For lrm the predicted values are probabilities (see kint).
一个标量或矢量预测值校准(lrm,ols“)。默认值是50第5和第5大预测值之间的等距点。对于lrm预测值的概率(见kint)。
参数:kint
For an ordinal logistic model the default predicted probability that Y≥q the middle level. Specify kint to specify the intercept to use, e.g., kint=2 means to calibrate Prob(Y≥q b), where b is the second level of Y.
默认的有序模型的预测概率,Y≥q中等水平。指定kint指定使用的拦截,例如,kint=2是指校准Prob(Y≥q b),b的Y是第二个层次。
参数:smoother
a function in two variables which produces x- and y-coordinates by smoothing the input y. The default is to use lowess(x, y, iter=0).
两个变量的函数产生x - y坐标平滑输入y。的默认使用lowess(x, y, iter=0)。
参数:digits
If specified, predicted values are rounded to digits digits before passing to the smoother. Occasionally, large predicted values on the logit scale will lead to predicted probabilities very near 1 that should be treated as 1, and the round function will fix that. Applies to calibrate.default.
如果指定,预测值均调整至digits数字才通过的平滑。有时候,会导致大预测值logit的规模非常接近1的预测概率,应被视为1,round功能将解决这个问题。适用calibrate.default。
参数:...
other arguments to pass to predab.resample, such as group, cluster, and subset. Also, other arguments for plot.
其他参数传递给predab.resample,如group,cluster和subset。此外,其他参数plot。
参数:xlab
defaults to "Predicted x-units Survival" or to a suitable label for other models
默认为“预测其他型号的X-单元生存”到一个合适的标签
参数:ylab
defaults to "Fraction Surviving x-units" or to a suitable label for other models
“分数生存X-单元”到一个合适的标签,其他型号的默认值
参数:xlim,ylim
2-vectors specifying x- and y-axis limits, if not using defaults
2矢量指定x-和y-轴的限制,如果不使用缺省值
参数:subtitles
set to FALSE to suppress subtitles in plot describing method and for lrm and ols the mean absolute error and original sample size
设置为FALSE抑制字幕图描述的方法和lrm和ols的平均绝对误差和原样本量
参数:conf.int
set to FALSE to suppress plotting 0.95 confidence intervals for Kaplan-Meier estimates
设置为FALSE抑制绘制Kaplan-Meier估计的0.95置信区间
参数:cex.subtitles
character size for plotting subtitles
字符大小绘制字幕
参数:riskdist
set to FALSE to suppress the distribution of predicted risks (survival probabilities) from being plotted
设置为FALSE抑制所绘制的预测风险的生存概率分布
参数:add
set to TRUE to add the calibration plot to an existing plot
设置TRUE添加校正曲线现有的图
参数:scat1d.opts
a list specifying options to send to scat1d if riskdist=TRUE. See scat1d.
指定选项的列表,发送到scat1d如果riskdist=TRUE的。见scat1d。
参数:legend
set to FALSE to suppress legends (for lrm, ols only) on the calibration plot, or specify a list with elements x and y containing the coordinates of the upper left corner of the legend. By default, a legend will be drawn in the lower right 1/16th of the plot.
设置为FALSE抑制传说(lrm,ols只)的校准曲线,或指定一个列表的元素x和y包含的坐标的左上角的传说。默认情况下,图例将被绘制在右下方的1/16th的图。
Details
详细信息----------Details----------
If the fit was created using penalized maximum likelihood estimation, the same penalty and penalty.scale parameters are used during validation.
如果配合使用惩罚最大似然估计,同样的penalty和penalty.scale参数的验证过程中使用。
值----------Value----------
matrix specifying mean predicted survival in each interval, the corresponding estimated bias-corrected Kaplan-Meier estimates, number of subjects, and other statistics. For linear and logistic models, the matrix instead has rows corresponding to the prediction points, and the vector of predicted values being validated is returned as an attribute. The returned object has class "calibrate" or "calibrate.default". plot.calibrate.default invisibly returns the vector of estimated prediction errors corresponding to the dataset used to fit the model.
矩阵指定在每个区间平均预测的生存,相应的估计偏差校正的Kaplan-Meier估计,科目,数量及其他统计资料。对于线性和Logistic模型,矩阵,而不是具有对应的预测点的行,被验证的预测值的矢量作为一个属性返回。返回的对象的类"calibrate"或"calibrate.default"。 plot.calibrate.default看不见的返回使用的数据模型,以适应相应的向量估计的预测误差。
副作用----------Side Effects----------
prints, and stores an object pred.obs or .orig.cal
打印,并存储对象pred.obs或.orig.cal
(作者)----------Author(s)----------
Frank Harrell<br>
Department of Biostatistics<br>
Vanderbilt University<br>
f.harrell@vanderbilt.edu
参见----------See Also----------
validate, predab.resample, groupkm, errbar, scat1d, cph, psm, lowess
validate,predab.resample,groupkm,errbar,scat1d,cph,psm,lowess
实例----------Examples----------
set.seed(1)
d.time <- rexp(200)
x1 <- runif(200)
x2 <- factor(sample(c('a','b','c'),200,TRUE))
f <- cph(Surv(d.time) ~ pol(x1,2)*x2, x=TRUE, y=TRUE, surv=TRUE, time.inc=2)
#or f <- psm(S ~ \dots)[或f < - 每平方米(S~\点)]
pa <- 'polspline' %in% row.names(installed.packages())
if(pa) {
cal <- calibrate(f, u=2, B=20) # cmethod='hare'[cmethod =“野兔”]
plot(cal)
}
cal <- calibrate(f, u=2, cmethod='KM', m=50, B=20) # usually B=200 or 300[通常B = 200或300]
plot(cal, add=pa)
y <- sample(0:2, 200, TRUE)
x1 <- runif(200)
x2 <- runif(200)
x3 <- runif(200)
x4 <- runif(200)
f <- lrm(y ~ x1+x2+x3*x4, x=TRUE, y=TRUE)
cal <- calibrate(f, kint=2, predy=seq(.2,.8,length=60),
group=y)
# group= does k-sample validation: make resamples have same [组= K-样品验证:品牌重新采样具有相同]
# numbers of subjects in each level of y as original sample[的主题在每个级别中y为原始样本数]
plot(cal)
#See the example for the validate function for a method of validating[见的例子验证功能验证的方法]
#continuation ratio ordinal logistic models. You can do the same[延续比有序Logistic模型。你可以做同样的]
#thing for calibrate[事情校准]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|