2

使用时间到事件数据并通过倾向得分对案例进行加权。我想研究方差估计方法如何影响 cox 比例风险模型中的 HR。这是到目前为止的代码

library("survival")
library("survminer")
library("WeightIt")
library("sandwich")
library("boot")
library("survey")
data("cancer", package = "survival")



weighting <- weightit(trt ~ risk+ laser + eye, data=diabetic, estimand = "ATE", method = "ps")

#using robust =TRUE
fit_normal <- coxph( Surv(time, status) ~ trt,
                 data = diabetic, weights = weighting$weights, robust=TRUE )

fit_normal
des <- svydesign(ids = ~1, weights = get.w(weighting),
                 data = diabetic)
fit.survey <- svycoxph(Surv(time,status)~trt,design=des)
coef(fit.survey)
exp(confint(fit.survey))
exp(confint(fit_normal))

我将如何进行引导以估计风险比的标准误差?

4

0 回答 0