找回密码
 注册
查看: 821|回复: 0

R语言 rms包 residuals.cph()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 19:14:29 | 显示全部楼层 |阅读模式
residuals.cph(rms)
residuals.cph()所属R语言包:rms

                                        Residuals for a cph Fit
                                         残差的CPH飞度

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Calculates martingale, deviance, score or Schoenfeld residuals  (scaled or unscaled) or influence statistics for a Cox proportional hazards model. This is a slightly modified version of Therneau's residuals.coxph function. It assumes that x=TRUE and y=TRUE were specified to cph, except for martingale residuals, which are stored with the fit by default.
计算鞅偏差,得分或的Schoenfeld残差(缩放或缩放的),或影响统计数据的Cox比例风险模型。这是一个稍作修改的版本Therneau的residuals.coxph函数。它假定这x=TRUE和y=TRUEcph,除了鞅残差,这是存储与契合默认情况下,被指定为。


用法----------Usage----------


## S3 method for class 'cph'
residuals(object,
      type=c("martingale", "deviance", "score", "schoenfeld",
             "dfbeta", "dfbetas", "scaledsch", "partial"), ...)



参数----------Arguments----------

参数:object
a cph object
cph对象


参数:type
character string indicating the type of residual desired; the default is martingale. Only enough of the string to determine a unique match is required. Instead of the usual residuals, type="dfbeta" may be specified to obtain approximate leave-out-one Δ βs.  Use type="dfbetas" to normalize the Δ βs for the standard errors of the regression coefficient estimates. Scaled Schoenfeld residuals (type="scaledsch", Grambsch and Therneau, 1993) better  reflect the log hazard ratio function than ordinary Schoenfeld residuals, and they are on the regression coefficient scale.   The weights use Grambsch and Therneau's "average variance" method.  
字符串指示残余所需的类型,默认为鞅。只有足够的需要确定一个唯一的匹配的字符串。而不是通常的残差,type="dfbeta"可能被指定为得到近似离开Δ β的。使用type="dfbetas"标准化Δ β的回归系数估计值的标准误差。标度的的Schoenfeld残差(type="scaledsch",Grambsch和Therneau,1993年)更好地反映log的危险比功能,比普通的Schoenfeld残差,和他们的回归系数规模。权重使用Grambsch Therneau的“平均方差”方法。


参数:...
see residuals.coxph
看到residuals.coxph


值----------Value----------

The object returned will be a vector for martingale and deviance  residuals and matrices for score and schoenfeld residuals, dfbeta, or dfbetas. There will be one row of residuals for each row in the input data (without collapse). One column of score and Schoenfeld residuals will be returned for each column in the model.matrix. The scaled Schoenfeld residuals are used in the cox.zph function.
返回的对象将是一个向量,鞅和偏差残差矩阵的比分和Schoenfeld残差,dfbeta,或dfbetas。在所输入的数据,将有一个行中的每一行的残差(无collapse)。一列中的每一列的model.matrix的得分和Schoenfeld残差将被退回。 cox.zph函数中使用缩放Schoenfeld残差。

The score residuals are each individual's contribution to the score vector.  Two transformations of this are often more useful: dfbeta is the approximate change in the coefficient vector if that observation were dropped, and dfbetas is the approximate change in the coefficients, scaled by the standard error for the coefficients.
score残差是每个人的贡献的得分向量。这两个转变往往更加有用:dfbeta是系数向量的近似变化,观察下降,和dfbetas大约是变化的系数,比例系数的标准误差为。


参考文献----------References----------

for survival models", Biometrika, March 1990.
based on weighted residuals", unpublished manuscript, Feb 1993.

参见----------See Also----------

cph, coxph, residuals.coxph, cox.zph, naresid
cph,coxph,residuals.coxph,cox.zph,naresid


实例----------Examples----------


# fit &lt;- cph(Surv(start, stop, event) ~ (age + surgery)* transplant, [符合< -  CPH(监测(启动,停止,事件)~(年龄+ *移植手术),]
#            data=jasa1)[数据= jasa1)]
# mresid &lt;- resid(fit, collapse=jasa1$id)[mresid < - 重油(适用崩溃jasa1 ID)]


# Get unadjusted relationships for several variables[未经调整的几个变量的关系]
# Pick one variable that's not missing too much, for fit[选择一个变量,不会错过太多,适合]


n &lt;- 1000    # define sample size[确定样本量]
set.seed(17) # so can reproduce the results[所以可以重现的结果]
age            <- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120, 15)
cholesterol    <- rnorm(n, 200, 25)
sex            <- factor(sample(c('female','male'), n,TRUE))
cens   <- 15*runif(n)
h      <- .02*exp(.04*(age-50)+.8*(sex=='Female'))
d.time <- -log(runif(n))/h
death  <- ifelse(d.time <= cens,1,0)
d.time <- pmin(d.time, cens)


f <- cph(Surv(d.time, death) ~ age + blood.pressure + cholesterol, iter.max=0)
res &lt;- resid(f) # This re-inserts rows for NAs, unlike f$resid[重新插入行来港定居,与F $渣油]
yl <- quantile(res, c(10/length(res),1-10/length(res)), na.rm=TRUE)
# Scale all plots from 10th smallest to 10th largest residual[从最小的10日至10日最大残留缩放所有的图]
par(mfrow=c(2,2), oma=c(3,0,3,0))
p <- function(x) {
  s <- !is.na(x+res)
  plot(lowess(x[s], res[s], iter=0), xlab=label(x), ylab="Residual",
       ylim=yl, type="l")
}
p(age); p(blood.pressure); p(cholesterol)
mtext("Smoothed Martingale Residuals", outer=TRUE)


# Assess PH by estimating log relative hazard over time[估计随着时间的推移log的相对危险评估PH]
f <- cph(Surv(d.time,death) ~ age + sex + blood.pressure, x=TRUE, y=TRUE)
r <- resid(f, "scaledsch")
tt <- as.numeric(dimnames(r)[[1]])
par(mfrow=c(3,2))
for(i in 1:3) {
  g <- areg.boot(I(r[,i]) ~ tt, B=20)
  plot(g, boot=FALSE)  # shows bootstrap CIs[显示引导的CI]
}                  # Focus on 3 graphs on right[重点3图右]
# Easier approach:[简单的方法:]
plot(cox.zph(f))    # invokes plot.cox.zph[调用plot.cox.zph]
par(mfrow=c(1,1))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-24 11:43 , Processed in 0.019465 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表