R语言
aggregate.survfit
位于 survival
包(package)。 说明
对于包含多条曲线的 survfit 对象,在分组上创建平均曲线。
用法
## S3 method for class 'survfit'
aggregate(x, by = NULL, FUN = mean, ...)
参数
x |
具有数据维度的 |
by |
分组元素的可选列表或向量,每个元素长为 |
FUN |
计算感兴趣的汇总统计量的函数。 |
... |
FUN 的可选进一步参数。 |
细节
其主要用途是对从建模函数创建的多个生存曲线取平均值。即生存的边际估计。它主要用于对 Cox 模型的多个预测曲线进行平均。
值
较低维度的 survfit
对象。
例子
cfit <- coxph(Surv(futime, death) ~ sex + age*hgb, data=mgus2)
# marginal effect of sex, after adjusting for the others
dummy <- rbind(mgus2, mgus2)
dummy$sex <- rep(c("F", "M"), each=nrow(mgus2)) # population data set
dummy <- na.omit(dummy) # don't count missing hgb in our "population
csurv <- survfit(cfit, newdata=dummy)
dim(csurv) # 2 * 1384 survival curves
csurv2 <- aggregate(csurv, dummy$sex)
也可以看看
相关用法
- R agreg.fit Cox模型拟合函数
- R aeqSurv 判定 Surv 对象中的邻近关系
- R aareg Aalen 针对删失数据的加性回归模型
- R attrassign 创建新样式的“分配”属性
- R aml 急性髓性白血病生存数据
- R anova.coxph Cox 模型的偏差分析。
- R hoel 小鼠癌症数据
- R survcondense 缩短 (time1, time2) 生存数据集
- R myeloid 急性粒细胞白血病
- R tobin 托宾的托比特数据
- R pseudo 生存的伪值。
- R levels.Surv 返回多状态 Surv 对象的状态
- R rats Mantel 等人的大鼠治疗数据
- R diabetic 糖尿病视网膜病变
- R pbc 梅奥诊所原发性胆汁性胆管炎数据
- R plot.survfit survfit 对象的绘图方法
- R kidney 肾导管数据
- R stanford2 更多斯坦福心脏移植数据
- R print.aareg 打印 aareg 对象
- R pyears 人年
- R residuals.survreg 计算“survreg”对象的残差
- R cgd0 慢性肉芽肿病数据
- R mgus2 单克隆丙种球蛋白病数据
- R model.frame.coxph coxph 对象的 Model.frame 方法
- R brier 计算 Cox 模型的 Brier 分数
注:本文由纯净天空筛选整理自R-devel大神的英文原创作品 Average survival curves。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。