'Create a column includes all confidence intervals
I have a code like that :
library("survival")
library("survminer")
data("lung")
res.cox <- coxph(Surv(time, status) ~ sex, data = lung)
x<-confint(res.cox)
I am looking to get all the confidence intervals, not only the upper and lower bands. So I will have a confidence interval for each participant (N=228). Actually, I need to plot the confidence intervals with their distributions.
Solution 1:[1]
If you want it to assign it to the data is :
lung$CI<- predict(res.cox)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ali Roghani |