Announcement

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

  • creating a Hazard ratio risk of failure vs mean annual volume with confidence intervals (st cox- margins plot)

    I would like to create a hazard ratio graph with 95% confidence intervals following stcox
    I have tried marginsplot but nothing

    Code:
    use "http://people.umass.edu/biep640w/datasets/pbc.dta"
    stset years, failure(status)
    stcox rx bilirubin albumin
    I would like to plot a Hazard ratio graph with 95% confidence interval with x variable bilirubin at level: 3, 10 , 20
    Similar to the graph below (obtained from quick google)

    *Please note with regards to my title: My question is looking at the mean annual volume of cars fixed by mechanics vs risk of failure of those cars.
    I have instead however tried to test with dummy data hence using the link above
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	50.8 KB
ID:	1725378

    Last edited by Tara Boyle; 29 Aug 2023, 08:35. Reason: explnaation re title and difference in data provided
Working...
X