Hello,
In continuation to the topic we discussed today in our workshp, in regard to the blog post about calculation of the added predictive information by a biomarker:
The example mentioned in the blog post, calculates the added predictive information of a biomarker in a Binary Logistic Model.
The example given, tries to assess the added information of a new biomarker (cholesterol) to a base model.
The formula to calculate the added information is:
fraction of new information= 1- variance(pre)/variance(post)
I will attach here the code used to calculate the variance of the model with the biomarker:
g <- lrm(sigdz ~ rcs(age,4) * sex + rcs(choleste,4) + rcs(age,4) %ia%
rcs(choleste,4), data=acath) # This is the basemodel+biomarker
post <- predict(g, type='fitted') # post-test probability
variance <- round(var(post), 3)
Summary
This text will be hidden
I tried to do the same calculations for a Cox proportional hazard model, would like to get feedback on the code/approach if that is possible:
I am attaching a hypothetical example, I am using a different package (that is the one I used at the time, would be happy to learn other ways of doing the calculations using the rms package)
Model <- coxph(Surv(surv_time, event) ~ biomarker+ variable1+variable2, data =mydata) # The base model+biomarker
# In to the predict the survival probability I am using exp(-expected), ref: https://cran.r-project.org/web/packages/survival/survival.pdf (page 86-87)
model_prediction <- predict(Model , type="expected")
model_prob <- exp(-model_predicton )
model_variance <- round(var(model_prob), 3)
Summary
This text will be hidden
I think my question is, how can I calculate the probability for the outcome in cox model?
I hope I am being clear enough!