Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to draw cubic splines after Cox regression

    Hello,
    Could anybody help me with syntaxis to do this graph? y axis= hazard ratio. x axis= covariate (continuous)
    I tried to use restricted cubic spline graph, but, stata says "macro substitution results in line that is too long"
    Thank you

  • #2
    I have a related question


    Hello everyone,



    In my data, after performing Cox analysis, there seems to be a non-linear relationship between exposure and outcome. So, I want to do the non-linear analysis using restricted cubic spline regression with 5 knots.

    I want to assess the non-linear association between carbohydrate intake (continues) and the hazard ratio of bladder cancer mortality (I have time to event (time to death) and mortality of bladder cancer patient as 0 and 1 code), moreover I need to draw plot that y axis= hazard ratio. x axis= carbohydrate

    First of all, I would appreciate it if you could guide me on whether it is possible to do this analysis because it seems that it is not possible to evaluate the time in the prediction model, the second hazard is not constant thus that seems we cannot have done, so our view of the outcome should be binary (1 and 0) without considering the time. But in some papers, I saw that it was done for example: https://pubmed.ncbi.nlm.nih.gov/32180207/

    If it is possible to do, could anybody help me with analyses and drawing graph syntax?




    thanks

    Comment

    Working...
    X