survfit.formula(rms)
survfit.formula()所属R语言包:rms
Compute a Survival Curve for Censored Data
计算一个数据截尾的生存曲线
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes an estimate of a survival curve for censored data using either the Kaplan-Meier or the Fleming-Harrington method or computes the predicted survivor function. For competing risks data it computes the cumulative incidence curve. This calls the survival package's survfit.formula function with a different default value for conf.type (log-log basis). In addition, attributes of the event time variable are saved (label and units of measurement).
删失数据的Kaplan-Meier法或佛兰芒哈灵顿方法或计算的预测生存函数的生存曲线计算的估计。对于竞争风险数据,它计算的累积发生率曲线。这survival包的survfit.formula功能用不同的默认值conf.type(log记录的基础上)。此外,事件时间变量的属性被保存(标签和计量单位)。
用法----------Usage----------
## S3 method for class 'formula'[类formula的方法]
survfit(formula, data, ...)
参数----------Arguments----------
参数:formula
a formula object, which must have a Surv object as the response on the left of the ~ operator and, if desired, terms separated by + operators on the right. One of the terms may be a strata object. For a single survival curve the right hand side should be ~ 1.
一个公式对象,它必须有一个Surv~操作员左侧的对象作为响应,并且如果需要的话,在右侧分离+的操作符的条款。其中一项条款可能是一个strata对象。对于一个单一的生存曲线的右手侧应该是~ 1。
参数:data
a data frame in which to interpret the variables named in the formula, subset and weights arguments.
一个数据框中解释变量命名的公式,subset和weights参数。
参数:...
see survfit.formula
看到survfit.formula
Details
详细信息----------Details----------
see survfit.formula for details
survfit.formula的详细信息,
值----------Value----------
an object of class "survfit". See survfit.object for details. Methods defined for survfit objects are print, plot, lines, and points.
对象类"survfit"。见survfit.object的详细信息。 survfit对象定义的方法是print,plot,lines和points。
(作者)----------Author(s)----------
Thomas Lumley <a href="mailto:tlumley@u.washington.edu">tlumley@u.washington.edu</a> and Terry Therneau
参见----------See Also----------
survfit.cph for survival curves from Cox models. print, plot, lines, coxph, Surv, strata.
survfit.cphCox模型的存活曲线。 print,plot,lines,coxph,Surv,strata。
实例----------Examples----------
require(survival)
#fit a Kaplan-Meier and plot it[适合Kaplan-Meier和绘制]
fit <- survfit(Surv(time, status) ~ x, data = aml)
plot(fit, lty = 2:3)
legend(100, .8, c("Maintained", "Nonmaintained"), lty = 2:3)
#fit a Cox proportional hazards model and plot the[适合Cox比例风险模型,并绘制]
#predicted survival for a 60 year old[一个60岁的预测生存]
fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)
plot(survfit(fit, newdata=data.frame(age=60)),
xscale=365.25, xlab = "Years", ylab="Survival")
# Here is the data set from Turnbull[下面是数据集从特恩布尔]
# There are no interval censored subjects, only left-censored (status=3),[有没有区间科目,只留审查(状态= 3),]
# right-censored (status 0) and observed events (status 1)[右删失(状态0)和观察的事件(状态1)]
#[]
# Time[时间]
# 1 2 3 4[1 2 3 4]
# Type of observation[观察类型]
# death 12 6 2 3[死亡12 6 2 3]
# losses 3 2 0 3[亏损3 2 0 3]
# late entry 2 4 2 5[逾期报名2 4 2 5]
#[]
tdata <- data.frame(time =c(1,1,1,2,2,2,3,3,3,4,4,4),
status=rep(c(1,0,2),4),
n =c(12,3,2,6,2,4,2,0,2,3,3,5))
fit <- survfit(Surv(time, time, status, type='interval') ~1,
data=tdata, weights=n)
#[]
# Time to progression/death for patients with monoclonal gammopathy[单克隆丙种球蛋白的患者进展/死亡时间]
# Competing risk curves (cumulative incidence)[竞争风险曲线(累积发病率)]
fit1 <- survfit(Surv(stop, event=='progression') ~1, data=mgus1,
subset=(start==0))
fit2 <- survfit(Surv(stop, status) ~1, data=mgus1,
subset=(start==0), etype=event) #competing risks[竞争风险]
# CI curves are always plotted from 0 upwards, rather than 1 down[CI曲线总是从0向上绘制,而不是1向下]
plot(fit2, fun='event', xscale=365.25, xmax=7300, mark.time=FALSE,
col=2:3, xlab="Years post diagnosis of MGUS")
lines(fit1, fun='event', xscale=365.25, xmax=7300, mark.time=FALSE,
conf.int=FALSE)
text(10, .4, "Competing Risk: death", col=3)
text(16, .15,"Competing Risk: progression", col=2)
text(15, .30,"KM:prog")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|