Announcement

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

  • Interaction p-value

    Dear listers,

    I’m currently working on a subgroup analysis. One of the variables of interest has four categories (1, 2, 3 and 4). I want to calculate interaction p-values to see if any of the four categories stands out. I’ve tried using this code:

    Stcox i.GHS##i.segment

    However, when I run this, I only get an interaction p-value between 1&2, 1&3 and 1&4. I want every category to be compared to the total study population.

    Any help is appreciated!

  • #2
    I can't tell which of the variables, GHS, or segment is the four category variable over which you want to make comparisons. I also don't know what you mean by "stand out"--the fact that your post's title refers to p-values suggests to me that you want to base that on p-values, which is not a great idea. But I'll spare you my rant about that topic. For purposes of illustration, let me assume that segment is the four-level variable.

    Anyway, you can get the hazard ratio specific to each of the four levels of segment, accompanied by confidence intervals by following the -stcox- command with:
    Code:
    margins segment
    If you want to do pairwise comparisons across those hazard ratios, then run -margins segment, pwcompare-.

    In general, statistical tests are not designed to contrast a category to a total population: the observations in such a contrast are necessarily not independent, so the usual assumptions required for statistical tests are violated that way. Statistical tests are generally designed to contrast a category with some other category, or with all other categories, but not category vs whole.

    Comment


    • #3
      Clyde has given some excellent advice. I will add, one alternative, if I interpret your question liberally. It may be that you want an joint test of significance for all interaction terms. That can be done using the code below, and if interested, followed up with a contrast or margins.

      Code:
      testparm i.GHS#i.segment  // note just one hash mark here, not two, which is expanded to only to the interaction terms

      Comment


      • #4
        Thank you for the answer!

        Yes, segment is the variable with four categories. GHS is a dichotomous variable. I should have made that clear, sorry!
        The other variables for the subgroup analysis are dichotomous. To calculate the interaction p-value for the dichotomous variables I can simply use for example:

        Code:
        Stcox i.GHS##i.gender

        But for segment this command contrasts category to category, which is not what I want. I tired the margins command, but it did not seem to help. Maybe it´s better to change approach and contrast each of the categories to all other categories like you said. Do you possibly know how most medicine studies make their subgroup analysis? Maybe the code below could work?

        Code:
        Stcox i.GHS##1.segment
        Stcox i.GHS##2.segment
        Stcox i.GHS##3.segment
        Stcox i.GHS##4.segment

        Regards, Sacharias von Koch

        Comment


        • #5
          This is screwy because of the underlying data, but it will show you how to test margins.
          Code:
          sysuse auto, clear
          stset length
          stcox  i.rep78##i.foreign
          margins, at(rep78=(1(1)5) foreign=(0 1)) post
          test [5._at]= [6._at]

          Comment

          Working...
          X