Announcement

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

  • What do the values of -margins- after -stcox- mean?

    Dear all,

    I'm running a Cox regression model using -stcox-. I'm interested in the effect of one continuous independent variable on the hazard to commit crime.
    The coefficient I get for this variable is positive and significant, and I want to illustrate the results using -margins-:

    Code:
    margins, at(independent_var=(0(0.2)1))
    If I understand correctly, what I get from -margins- after -stcox- is the "relative hazard". But this is relative to what?
    For example, if I get that 0.8 for a value of 0.5 for the independent variable, what does that mean?

    Thanks!

  • #2
    The results are hazard ratios relative to the baseline hazard that -stcox- estimates. That baseline hazard is the hazard when all continuous variables are zero and all discrete variables are at their base level (assuming you properly used factor-variable notation in -stcox-).

    Comment


    • #3
      Thanks Clyde Schechter!

      So if I add the -atmeans- option, the baseline hazard will be the hazard when all variables are at their means (and not zero)?

      Comment


      • #4
        So if I add the -atmeans- option, the baseline hazard will be the hazard when all variables are at their means (and not zero)?
        No. The baseline hazard is calculated in -stcox-, not in -margins-, and -stcox- does not have an -atmeans- option. If you want the baseline hazard to be with all variables at their means, you have to go back and center all the variables at their means and then re-run -stcox- and then run -margins-.

        Comment


        • #5
          Got it. Thanks!

          Comment


          • #6
            Dear Clyde Schechter,

            I have a follow-up question please:

            Is there any way to get any predicted hazard for my dependent variable (crime), and not a ratio relative to something?
            In other words, I want to get the predicted risk of committing a crime based on the values of an independent variable. with that, I want to be able to say, for example, that for those with a value of X in the independent variable, the risk for committing crime is Y.
            Is that possible?

            Thanks!

            Comment


            • #7
              -stcurve- is a post-estimation command that you can run after -stcox-. You can specify the values of the covariates you want to constrain, and then -stcurve- plots a graph of cumulative probability of failure (or survival--your choice) as a function of time. It also has an -outfile()- option that lets you save the coordinates of the points in the curve as a Stata data set.

              Comment

              Working...
              X