s@ski@@grob m@iii@g oii quickii@e@ch
2022-Aug-03 06:37 UTC
[R] cumulative survival/number of deaths after weighting using survey::svykm()
Hey guys. I have a question. I drew a weighted Kaplan-Meier survival plot using the survey::svykm() function, like this: ``` library(survey) data(pbc, package="survival") pbc$randomized <- with(pbc, !is.na(trt) & trt>0) biasmodel <- glm(randomized~age*edema,data=pbc) pbc$randprob <- fitted(biasmodel) dpbc<-svydesign(id=~1, prob=~randprob, strata=~edema, data=subset(pbc,randomized)) s2 <-svykm(Surv(time,status==1) ~ sex, design = dpbc) ``` Now I would like to calculate the survival rates and number of deaths after x months similar to what I would get when using summary(s2, times = 320) on a survfit object. Does anybody know how I can extract these values? Many thanks in advance! Saskia [[alternative HTML version deleted]]