I am looking at the association between PM2.5 exposure and death in an cohort of patients with Idiopathic interstitial pneumonia (IPF)
PM_5yrprecensor is a continious variable
#cox model
coxPH_model1_tvc <- cox.tvc(coxPH_model1, "PM_5yrPreCensor") print(coxPH_model1_tvc) plot(coxPH_model1_tvc)
#survival function
surv1 <- Surv(PMx2024$SURVT_use2022, PMx2024$MORT_use2022==1) fit1 <- coxph(surv1 ~ pspline(PMx2024$PM_5yrPreCensor, df=4)) predicted <- predict(fit1, type="terms", se.fit=T, terms=1) print(predicted)
#plot to visualise the infection of the curve
plot(PMx2024$PM_5yrPreCensor, exp(predicted$fit), type="n", xlim=c(5,20), ylim=c(0,6)) lines(sm.spline(PMx2024$PM_5yrPreCensor, exp(predicted$fit)), col = "red" , lty = 1 ) lines(sm.spline(PMx2024$PM_5yrPreCensor, exp(predicted$fit + 1.96 * predicted$se)), col = "orange" , lty = 2 ) lines(sm.spline(PMx2024$PM_5yrPreCensor, exp(predicted$fit - 1.96 * predicted$se)), col = "orange" , lty = 2 ) abline(h = 1, col = "blue", lty = 3)
how can I find the risk inflection point in this survival function?
Apart from visualisation how can I find the risk inflection point in this curve?