IPW+Coxå帰
ATEã¨ãã¦ãã¶ã¼ãæ¯ãæ±ããå¿ è¦ããã£ãã®ã§ãIPWã使ã£ãã ããã¼ãã¼ã¿ã§åå¿é²ãæ®ãã¦ããã
library(survminer) library(survival) library(cobalt) library(tidyverse) # ãã¼ã¿ã®æºå diabetic_mod <- diabetic %>% filter(eye == "left") %>% mutate(flag_highrisk = if_else(risk >= 10, 1, 0)) # KMæ²ç·ã®æç» surv <- survfit(Surv(time, status) ~ trt, data = diabetic_mod) ggsurvplot(surv) # Coxå帰 fit <- coxph(Surv(time, status) ~ trt, data = diabetic_mod) summary(fit) # IPW + Coxå帰 # weightsã«IPWã®éã¿ãä¸ãã library(WeightIt) model_ipw <- weightit(trt ~ flag_highrisk, data = diabetic_mod, estimand = "ATE", method = "ps" ) fit_ipw <- coxph(Surv(time, status) ~ trt, data = diabetic_mod, weights = get.w(model_ipw)) summary(fit_ipw)
ã¾ããå°éå¤ã®äººã«èª¬æããã¨ãã¯å¾åã¹ã³ã¢ãããã³ã°ã®æ¹ã説æãããããã ãã©ãããã ã¨ATTã¨ãªã£ã¦ãã¾ãã®ã§...
éã¿ä»ãCoxå帰ã ã¨coxphwããã±ã¼ã¸ãç¨ããæ¹ãé©åãããããªãããä»åã¯ãã¤ã¼ãã«coxph()ã§å®æ½ãã¦ããã çµæã¯coxphw()ã®template="PH"ã¨ããå ´åã¨ã»ã¼ä¸è´ããã stats.stackexchange.com