79468172

Date: 2025-02-26 00:04:18
Score: 2.5
Natty:
Report link

Thank you Raramai and Zhihan for your solutions. Neither worked in isolation for me but works when combined both solutions.

I am using R version 4.4.0 on PC windows.

Step 1. create Surv() object to feed into coxph() function.

eg.

cx1 <- Surv(df$time_variable,df$censor_variable)

cox <-coxph(cx1~covariate1 + covariate2, data=df)

AND Step 2. use as.data.frame() function on data within the ggforest() function

eg. ggforest(cox,data=as.data.frame(df))

Thank you Mary for posting the initial question.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Carl