Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Extract 95% confidence interval values from kaplan meier model

After computing a kaplan meier model I get the km_fit list below. How can I extract 95% confidence interval values now?

# Plot Kaplan-Meier curves
sg1_survival <- Surv(
  time = sg1$`Time from breast cancer diagnosis to bone metastasis (months) (NA = unknown)`,
  event = sg1$`status (=1 as all pts have bone metastasis and BC)`
)


km_fit <- survfit(sg1_survival ~ sg1$`Molecular type (0=hr+her2+, 1=hr+her2-, 2=hr-her2+, 3=TNBC)`, data = sg1)

# Calculate 95% confidence intervals? fails with "no applicable method"
ci <- confint(km_fit, level = 0.95)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It’s all in km_fit.


km_fit <- survfit(sg1_survival ~ sg1$`Molecular type (0=hr+her2+, 1=hr+her2-, 2=hr-her2+, 3=TNBC)`, data = sg1)
c <- data.frame(km_fit$time, km_fit$lower, km_fit$upper) 
c

 sum.time  sum.lower sum.upper
1  28.37260 0.29950713         1
2  34.15890 0.06727839         1
3 137.32603         NA        NA
4  14.00548 0.12504883         1
5  75.02466         NA        NA

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading