1
如何从脆弱模型(使用R coxph)生成预测的幸存者曲线?
我想计算一个脆弱的考克斯比例风险模型的预测幸存者功能[使用生存包]。看起来当脆弱项在模型中时,无法计算预测的幸存者功能。 ## Example require(survival) data(rats) ## Create fake weight set.seed(90989) rats$weight<-runif(nrow(rats),0.2,0.9) ## Cox model with gamma frailty on litter fit <- coxph(Surv(time, status) ~ rx+weight+frailty(litter,dist="gamma"), data = rats) ## Compute survival curve from the cox model for rx=0 and weight=0.5 kg plot(survfit(fit, newdata=data.frame(rx=0,weight=0.5)),xlab = "time", ylab="Survival") ## Running this line, …