survest.cph(rms)
survest.cph()所属R语言包:rms
Cox Survival Estimates
Cox生存估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute survival probabilities and optional confidence limits for Cox survival models. If x=TRUE, y=TRUE were specified to cph, confidence limits use the correct formula for any combination of predictors. Otherwise, if surv=TRUE was specified to cph, confidence limits are based only on standard errors of log(S(t)) at the mean value of X beta. If the model contained only stratification factors, or if predictions are being requested near the mean of each covariable, this approximation will be accurate. Unless times is given, at most one observation may be predicted.
计算Cox生存模型的生存概率和可选的置信限。如果x=TRUE, y=TRUE被指定为cph,置信限的任意组合的预测中使用了正确的公式。否则,surv=TRUE被指定为cph,只是基于标准误差置信限log(S(t))的平均值的X beta。如果模型只包含分层因素,如果被要求预测每个协变量的平均值附近,近似准确。除非times,绝大多数的观察可以预测。
用法----------Usage----------
survest(fit, ...)
## S3 method for class 'cph'
survest(fit, newdata, linear.predictors, x, times,
fun, loglog=FALSE, conf.int=0.95, type, vartype,
conf.type=c("log", "log-log", "plain", "none"), se.fit=TRUE,
what=c('survival','parallel'),
individual=FALSE, ...)
参数----------Arguments----------
参数:fit
a model fit from cph
一个模型的拟合从cph
参数:newdata
a data frame containing predictor variable combinations for which predictions are desired
包含预测变量的组合预测所需的数据框
参数:linear.predictors
a vector of linear predictor values (centered) for which predictions are desired. If the model is stratified, the "strata" attribute must be attached to this vector (see example).
一个向量的线性预测值(中心)的预测是理想的。如果模型是分层的,“阶层”属性必须被连接到向量(见例子)。
参数:x
a design matrix at which to compute estimates, with any strata attached as a "strata" attribute. Only one of newdata, linear.predictors, or x may be specified. If none is specified, but times is specified, you will get survival predictions at all subjects' linear predictor and strata values.
在计算估计的设计矩阵,与任何阶层的“阶层”属性附加。可以指定只有一个newdata,linear.predictors或x。如果没有指定,但times指定,你会得到生存的预测,在所有的线性预测和阶层的价值观。
参数:times
a vector of times at which to get predictions. If omitted, predictions are made at all unique failure times in the original input data.
次在哪些得到预测的矢量。如果省略,则在原来的输入数据在各独特的失败次数进行预测。
参数:loglog
set to TRUE to make the log-log transformation of survival estimates and confidence limits.
设置为TRUElog-log转型生存的估计和置信限。
参数:fun
any function to transform the estimates and confidence limits (loglog is a special case)
任何函数,改造的估计和置信限(loglog是一个特殊的情况下)
参数:conf.int
set to FALSE or 0 to suppress confidence limits, or e.g. .95 to cause 0.95 confidence limits to be computed
设置为FALSE或0抑制置信区间,或如.95造成0.95的置信区间计算
参数:type
see survfit.coxph
看到survfit.coxph
参数:vartype
see survfit.coxph
看到survfit.coxph
参数:conf.type
specifies the basis for computing confidence limits. "log" is the default as in the survival package.
指定的基础上的计算置信界限。 "log" survival包是默认的。
参数:se.fit
set to TRUE to get standard errors of log predicted survival (no matter what conf.type is). If FALSE, confidence limits are suppressed.
设置为TRUE得到标准错误log的预测生存(不管什么conf.type是)。如果FALSE,置信界限被抑制。
参数:individual
set to TRUE to have survfit interpret newdata as specifying a covariable path for a single individual (represented by multiple records).
设置为TRUEsurvfit解释newdata指定一个协变量的路径为同一个人为代表的多条记录。
参数:what
Normally use what="survival" to estimate survival probabilities at times that may not correspond to the subjects' own times. what="parallel" assumes that the length of times is the number of subjects (or one), and causes survest to estimate the ith subject's survival probability at the ith value of times (or at the scalar value of times). what="parallel" is used by val.surv for example.
通常使用what="survival"估计生存概率的时间可能不符合自己的时代。 what="parallel"假设times的长度是多少的主题(或一个),并导致survesttimes在第i个值(估计第i个对象的生存概率或在times)的标量值。 what="parallel"使用val.surv的例子。
参数:...
unused
未使用的
Details
详细信息----------Details----------
The result is passed through naresid if newdata, linear.predictors, and x are not specified, to restore placeholders for NAs.
结果通过naresid如果newdata,linear.predictors和x不指定,NA的恢复占位符。
值----------Value----------
If times is omitted, returns a list with the elements time, n.risk, n.event, surv, call (calling statement), and optionally std.err, upper, lower, conf.type, conf.int. The estimates in this case correspond to one subject. If times is specified, the returned list has possible components time, surv, std.err, lower, and upper. These will be matrices (except for time) if more than one subject is being predicted, with rows representing subjects and columns representing times. If times has only one time, these are reduced to vectors with
如果times省略,返回一个列表中的元素time,n.risk,n.event,surv,call(调用语句),和可选std.err,upper,lower,conf.type,conf.int。在这种情况下,估计对应于一个主题。如果times指定,返回的列表有可能的组成部分time,surv,std.err,lower和upper。这将是矩阵(除了为time),如果有一个以上的主题是预测,随着行代表的主题和列代表times。如果times具有只有一个时间,这些都降低到矢量
(作者)----------Author(s)----------
Frank Harrell<br>
Department of Biostatistics<br>
Vanderbilt University<br>
f.harrell@vanderbilt.edu
参见----------See Also----------
cph, survfit.cph, survfit.coxph, predictrms, survplot
cph,survfit.cph,survfit.coxph,predictrms,survplot
实例----------Examples----------
# Simulate data from a population model in which the log hazard[从人口模型的模拟数据,在该log的危险]
# function is linear in age and there is no age x sex interaction[函数是线性的,在年龄,有没有年龄的X性互动]
# Proportional hazards holds for both variables but we[比例风险持有两个变量,但我们]
# unnecessarily stratify on sex to see what happens[不必要的分层性,看看会发生什么]
n <- 1000
set.seed(731)
age <- 50 + 12*rnorm(n)
label(age) <- "Age"
sex <- factor(sample(c('Male','Female'), n, TRUE))
cens <- 15*runif(n)
h <- .02*exp(.04*(age-50)+.8*(sex=='Female'))
dt <- -log(runif(n))/h
label(dt) <- 'Follow-up Time'
e <- ifelse(dt <= cens,1,0)
dt <- pmin(dt, cens)
units(dt) <- "Year"
dd <- datadist(age, sex)
options(datadist='dd')
Srv <- Surv(dt,e)
f <- cph(Srv ~ age*strat(sex), x=TRUE, y=TRUE) #or surv=T[或存活率= T]
survest(f, expand.grid(age=c(20,40,60),sex=c("Male","Female")),
times=c(2,4,6), conf.int=.9)
f <- update(f, surv=TRUE)
lp <- c(0, .5, 1)
f$strata # check strata names[检查阶层名称]
attr(lp,'strata') <- rep(1,3) # or rep('sex=Female',3)[或代表(性别=女,3)]
survest(f, linear.predictors=lp, times=c(2,4,6))
# Test survest by comparing to survfit.coxph for a more complex model[测试survest比较到survfit.coxph为更复杂的模型]
f <- cph(Srv ~ pol(age,2)*strat(sex), x=TRUE, y=TRUE)
survest(f, data.frame(age=median(age), sex=levels(sex)), times=6)
age2 <- age^2
f2 <- coxph(Srv ~ (age + age2)*strata(sex))
new <- data.frame(age=median(age), age2=median(age)^2, sex='Male')
summary(survfit(f2, new), times=6)
new$sex <- 'Female'
summary(survfit(f2, new), times=6)
options(datadist=NULL)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|