Announcement

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

  • what are the hr numerator hr dominator in stpm2

    Hi can anyone link me to any resources to understand the importance of

    hrnumerator vs hrdenominator in stpm2?

    I found some stuff online but the workbook doesn't have answers

    https://www.pauldickman.com/survival/labs.pdf


    What should I pick as hrdenominator and is it important? soUNDS LIKE it is as he continues to explain that if hrdenominator is not specified all covariates are set at 0
    Does this matteR? and if so when does it matteR?


    Click image for larger version

Name:	Screenshot 2023-11-12 at 19.38.23.png
Views:	1
Size:	329.3 KB
ID:	1733633


    He gives an example here with denominator - but I don't understand:
    hrnum (female 1 agegrp4 1 ) /// this mean females + oldest females hrdenom(agegrp4 1 ) ci ///this also means oldest people
    So how does this exactly make sense?

    Click image for larger version

Name:	Screenshot 2023-11-12 at 19.43.13.png
Views:	1
Size:	388.0 KB
ID:	1733636
    Attached Files

  • #2
    In general, the HR is the ratio of the hazard for a group with one set of covariate values (defined in hrnumerator) and the hazard for a group with another set of covariate values (defined in hrdenominator).

    For example, if the variable female is coded 1 for females and 0 for males and you fit a proportional hazards model (no interactions or tvc), then

    Code:
    predict hr, hrnumerator(female 1) hrdenominator(female 0)
    will result in the new variable hr which is constant for all observations and equal to the HR from the table of parameter estimates. Any covariates not specified in hrnum() or hrdenom() are assumed to be zero so we don't actually need to specify hrdenominator(female 0).

    One can also get the HR for, for example, unexposed females to exposed males.

    Code:
    predict hr2, hrnumerator(female 1 exposed 0) hrdenominator(female 0 exposed 1)
    -predict hr- is primarily used in models with interactions and tvcs (i.e., where the predicted HR varies over values of time or another covariate).

    If we fit a model with tvc(female) with no interactions or other tvcs and do the following:

    Code:
    predict hr3, hrnumerator(female 1 exposed 0) hrdenominator(female 0 exposed 0)
    predict hr4, hrnumerator(female 1 exposed 1) hrdenominator(female 0 exposed 1)
    then hr3=hr4 and the values will vary over time. Note that the following is equivalent:

    Code:
    predict hr3, hrnumerator(female 1)
    predict hr4, hrnumerator(female 1 exposed 1) hrdenominator(exposed 1)
    In short, you specify hrnumerator() and hrdenominator() so as to specify the contrasts of interest to you. Documentation is in the help file and the Lambert&Royston book. The underlying ideas, however, are not specific to flexible parametric models. It follows from basic concepts in parameterising statistical models, interpreting parameter estimates, and estimating contrasts of interest.

    The example with two time-varying covariates is to illustrate a feature of flexible parametric models on the log cumulative hazard scale. Flexible parametric models, as described by Royston and Parmar and implemented in -stpm2- are estimated on the log cumulative hazard scale. Assuming proportional cumulative hazards usually implies proportional hazards and that the expected properties of multiplicative models hold. For example, we expect hr3 and hr4 to be equivalent. However, if we fitted a model with tvc(female exposed) then hr3 and hr4 will be similar but no longer guaranteed to be equivalent. If one has multiple tvcs then proportional cumulative hazards no longer implies proportional hazards. -stpm3- allows one to model on either the log cumulative hazard or the log hazard scale. If we model on the log hazard scale then hr3 and hr4 are guaranteed to be equivalent.

    Note that Paul Lambert wrote both stpm2 and the teaching exercise cited by OP. OP didn’t suggest otherwise, but I eanted to clarify.
    Last edited by Paul Dickman; 13 Nov 2023, 01:22.

    Comment


    • #3
      Thanks for this reply, If I have 2 tvcs
      exposed and female (0 male, 1 female)

      Exposed is my treatment variable - 0 standard treatment 1 new treatment

      Code:
      stpm2 exposed female asa age, scale(h) df(5) eform tvc (male treatment) dftvc(3)
      if I wanted to fit a model for treatment variable and for female gender, would the code still be

      Code:
       
       predict hr3, hrnumerator(female 1 exposed 0) hrdenominator(female 0 exposed 0) predict hr4, hrnumerator(female 1 exposed 1) hrdenominator(female 0 exposed 1)
      on another note if I may, how does one decide how many degrees of freedom to use ?

      on my code I just use the same as you use in your example dftvc (3) df(5)

      but essentially I’m copying what you suggest but not understanding the logic - really appreciate your thoughts

      in addition , i’m sure you’re busy but if I may, link you to my post here:
      https://www.statalist.org/forums/for...p-lambert-data

      Comment

      Working...
      X