Announcement

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

  • Graph hazard rates values with 95% CI over a dependant variable

    Hello All,

    I would like use Stata to make a graph Hazard of rates values with a 95% over different values of a independent variable. But I am really stuck on how I can do this? I have been exploring the sts graph function but it seems to graph over time. I have attached an example of a similar graph that I would like to make. This example is taken from Strahilevitz. M., Odean, T, Barber, B, (2011) "Once Burned, Twice Shy: How Naive Learning, Counterfactuals, and Regret Affect the Repurchase of Stocks Previously Sold" Journal of Marketing Research, 48 pp. S102-S120, doi 10.1509/jmkr.48.SPL.S102,

    In this graph, the hazard rate over different values of "Return Earned" are presented. In my data I have a variable "commission" and I want to graph hazard rate values over.
    Any help would be greatly appreciated.

    Regards,
    Daniel Richards
    Click image for larger version

Name:	Example Hazard Rate Graph.jpg
Views:	2
Size:	56.9 KB
ID:	1374646


    Attached Files

  • #2
    So, how have you calculated your hazard ratios? If you used -stcox- or -stcrreg- or one of the -streg- models, you can follow that up with -margins- and -marginsplot-. The 95% CI's won't be presented as curves around the average hazard ratio, but rather as error-bars above and below the points you select to plot. Moreover, you can customize the appearance of the plot you get by using almost any option available in -graph twoway-. Or, if you run -margins- with the -saving()- option, you can store the results in a data file and then use -graph twoway- to create a plot more like what you show in your post if that particular format is important.

    Comment


    • #3
      Thanks Clyde,

      I have been using the stcox command. What you said about storing the hazard ratios makes sense!! I just needed to come from the problem from a different angle. Much obliged!

      Regards,
      Daniel Richards

      Comment

      Working...
      X