Announcement

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

  • Help with interpreting regression results

    I run this code in Stata 17
    Code:
    reg sbpd ib6.group i.black_or_not ib6.group#i.black_or_not i.sex age stratum urpot, cformat(%9.2f) vce(cluster clinic)
    testparm i.black_or_not#i.group
    contrast r.black_or_not@group, cformat(%9.2f)
    And the result is displayed below:

    Code:
    Linear regression                               Number of obs     =        884
                                                    F(2, 3)           =          .
                                                    Prob > F          =          .
                                                    R-squared         =     0.1284
                                                    Root MSE          =     10.644
    
                                              (Std. err. adjusted for 4 clusters in clinic)
    ---------------------------------------------------------------------------------------
                          |               Robust
                     sbpd | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    ----------------------+----------------------------------------------------------------
                    group |
              Acebutolol  |      -8.00       1.87    -4.27   0.024       -13.96       -2.04
              Amlodipine  |      -6.47       1.30    -4.97   0.016       -10.60       -2.33
          Chlorthalidone  |      -7.51       2.29    -3.28   0.046       -14.80       -0.22
               Doxazosin  |      -5.61       1.24    -4.52   0.020        -9.56       -1.66
               Enalapril  |      -5.77       2.56    -2.26   0.109       -13.90        2.37
                          |
             black_or_not |
                   Black  |       3.10       1.55     2.01   0.139        -1.82        8.02
                          |
       group#black_or_not |
        Acebutolol#Black  |       0.27       0.70     0.39   0.722        -1.95        2.50
        Amlodipine#Black  |      -0.71       0.81    -0.88   0.444        -3.29        1.86
    Chlorthalidone#Black  |      -4.16       2.25    -1.84   0.162       -11.33        3.02
         Doxazosin#Black  |       3.46       2.26     1.53   0.223        -3.74       10.67
         Enalapril#Black  |       1.35       4.73     0.29   0.793       -13.71       16.42
                          |
                    2.sex |      -0.55       0.49    -1.12   0.345        -2.10        1.01
                      age |      -0.27       0.05    -5.71   0.011        -0.42       -0.12
                  stratum |       2.15       0.65     3.31   0.045         0.08        4.22
                    urpot |      -0.04       0.05    -0.82   0.471        -0.21        0.13
                    _cons |       2.46       3.59     0.68   0.543        -8.95       13.86
    ---------------------------------------------------------------------------------------
    
    .
    . testparm i.black_or_not#i.group
    
     ( 1)  1.group#2.black_or_not = 0
     ( 2)  2.group#2.black_or_not = 0
     ( 3)  3.group#2.black_or_not = 0
     ( 4)  4.group#2.black_or_not = 0
     ( 5)  5.group#2.black_or_not = 0
           Constraint 1 dropped
           Constraint 2 dropped
    
           F(  3,     3) =   15.80
                Prob > F =    0.0242
    
    .
    . contrast r.black_or_not@group, cformat(%9.2f)
    
    Contrasts of marginal linear predictions
    
    Margins: asbalanced
    
    ------------------------------------------------------------------------
                                         |         df           F        P>F
    -------------------------------------+----------------------------------
                      black_or_not@group |
        (Black vs Not Black) Acebutolol  |          1        7.58     0.0705
        (Black vs Not Black) Amlodipine  |          1        6.64     0.0820
    (Black vs Not Black) Chlorthalidone  |          1        0.34     0.6012
         (Black vs Not Black) Doxazosin  |          1       27.40     0.0136
         (Black vs Not Black) Enalapril  |          1        1.52     0.3059
           (Black vs Not Black) Placebo  |          1        4.02     0.1386
                                  Joint  |          3       19.14     0.0185
                                         |
                             Denominator |          3
    ------------------------------------------------------------------------
    
    --------------------------------------------------------------------------------------
                                         |   Contrast   Std. err.     [95% conf. interval]
    -------------------------------------+------------------------------------------------
                      black_or_not@group |
        (Black vs Not Black) Acebutolol  |       3.37       1.23         -0.53        7.28
        (Black vs Not Black) Amlodipine  |       2.39       0.93         -0.56        5.34
    (Black vs Not Black) Chlorthalidone  |      -1.06       1.81         -6.82        4.71
         (Black vs Not Black) Doxazosin  |       6.57       1.25          2.57       10.56
         (Black vs Not Black) Enalapril  |       4.46       3.62         -7.06       15.97
           (Black vs Not Black) Placebo  |       3.10       1.55         -1.82        8.02
    --------------------------------------------------------------------------------------
    
    .

    I am surprised to find out that the interaction for the main effect of race "Black" is the same coefficient as the contrast of "Black vs. not Black Placebo". Both are highlighted in red text above. Any guidance on my code and/or output will be appreciated.

    Al Bothwell
    Last edited by Al Bothwell; 27 Feb 2022, 22:45.

  • #2
    You shouldn't be surprised at that, and there is nothing wrong with your code, nor the output. That is precisely how interaction models work. When you have an interaction i.X##i.Y in your model, the coefficient of 1.X in the model is always the effect of X=1 conditional on Y = omitted category of the Y variable. If you were under the impression that the coefficient of 1.X is some kind of average effect of X, well, that is just a misunderstanding on your part.

    If you were to do the contrasts in the other direction, you would also find that the coefficient of, say, Clorthalidone is exactly the same as the contrast of Clorthalidone vs Placebo among non-Blacks.

    For a full explanation of the interpretation of coefficients in interaction models, the excellent Richard Williams' https://www3.nd.edu/~rwilliam/stats2/l53.pdf provides great clarity..
    Last edited by Clyde Schechter; 27 Feb 2022, 23:21.

    Comment


    • #3
      Thank you for the explanation.

      Comment


      • #4
        I did a relatively simple ordered regression and now I am confused

        Comment


        • #5
          Did I make an error in the command? I am very very new to stata.
          Attached Files

          Comment


          • #6
            Please read the Forum FAQ, with special attention to #12 for advice on the effective ways to state problems and show example data, code, and results. In particular:

            1. "I am confused" is not a clear description of a problem that anybody can help you with. You need to state what you are doing, what results you are getting, and why they differ from what you expected.
            2. Attachments are generally deprecated on this Forum, especially Microsoft Word documents, which can contain active Malware. Use code delimiters, as explained in FAQ #12, to show code and output here.
            3. It is usually wise to also show example data, using the -dataex- command, as explained in FAQ #12.

            I'm sorry for not giving you a warmer welcome to this Forum, but what you've posted is simply not enough to work with to even know what your question is, let alone answer it.

            Comment

            Working...
            X