Announcement

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

  • Statistical test for difference between three HRs?

    Hi all,

    I am studying the effect of a medication on a cancer outcome. I have stratified the exposure into three distinct/different groups, and have obtained HRs and corresponding 95% CIs for all three groups.

    Is there some kind of simple statistical test I can use to test for an overall difference between all the groups? Obviously comparing between 1 and 2, 2 and 3, and 1 and 3 is simple, but I wasn't sure about a test for all three groups at once.

    Thanks, Oliver

  • #2
    Estimate them in one model with interaction terms, and use test (a Wald test) to test if all interaction terms are equal to 0
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Originally posted by Maarten Buis View Post
      Estimate them in one model with interaction terms, and use test (a Wald test) to test if all interaction terms are equal to 0
      Thanks for your response Maarten, much appreciated.

      I grouped the variable I am interested in stratifying by into 4 categories (0, 1, 2 and 3). I then ran an interaction between my medication variable and the categorical variable like so:

      Code:
      stcox binarymedicationvariable##categoryvariable
      I then ran the following test:

      Code:
      testparm binarymedicationvariable##categoryvariable
      Is this correct? If I just use test, then I am not performing a global test across all groups, correct?

      Comment


      • #4
        You can do a global test with test, testparm is just convenient but otherwise equivalent. Now that is not saying anything bad: if two commands are equivalent for your purpose and one is more convenient than the other, then choosing the convenient one is the obvious choice...
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Originally posted by Maarten Buis View Post
          You can do a global test with test, testparm is just convenient but otherwise equivalent. Now that is not saying anything bad: if two commands are equivalent for your purpose and one is more convenient than the other, then choosing the convenient one is the obvious choice...
          Thanks again Maarten.

          When I run
          Code:
          testparm binarymedicationvariable#categoryvariable
          , I get output as I'd expect.

          How would I run the test command to derive similar output? If I run
          Code:
          test binarymedicationvariable#categoryvariable
          , STATA tells me "binarymedicationvariable#categoryvariable not found". I can run
          Code:
          test 1.binarymedicationvariable#1.categoryvariable
          , but that is obviously not a global test...

          Oliver


          Comment


          • #6
            Originally posted by Oliver Scott View Post
            How would I run the test command to derive similar output?
            You would write out each interaction,
            Code:
            sysuse auto, clear
            recode mpg (0/19=0) (20/29=1) (nonmi=2)
            reg price foreign#mpg
            testparm foreign#mpg
            test 1.foreign#0.mpg 0.foreign#1.mpg 1.foreign#1.mpg 0.foreign#2.mpg 1.foreign#2.mpg

            Comment

            Working...
            X