Announcement

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

  • margins following stcox

    Hi I would like to calculate the hazard ratio for each level of the scorequartile variable (0-4) for each treatment in procedure =1 and procedure = 0
    I have tried the following, but it doesn't really make any sense


    Scorequartile is an ordinal variable
    1 - Patient score 0 - 26
    2 - Patient score 26.25-36
    3 - Patient score 36.25 = 42
    4 - Patient score 42.5 - 48

    Procedure - categorical variable where 0 is control 1 = new treatment

    AiM: To plot hazard ratio for each score quartile for procedure = 0 and procedure 1
    Using this as a sensitivity analysis

    Code:
    stset survvialt [pw=attweight], failure(failed==1) 
    stcox i.scorequartile i.procedure age##age
    
    margins, at(scorequartile=(1 2 3 4) procedure=(0 1))
    The output doesn't make sense, with margins of 1256 which doesn't make sense as my initial cox model output makes sense where at the quartile increases to 4 the hazard ratio decreases which makes sense, patients are more satisfied therefore less likely for procedure to be called a failure.

    Is there something wrong my margins code?

    Which I don't understand
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	8.6 KB
ID:	1741539
    Attached Files
    Last edited by Tara Boyle; 30 Jan 2024, 09:17.
Working...
X