Announcement

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

  • comparison of coefficients

    Dear Stata Users,


    I am trying to interpret a comparison of coefficients. I have two different ways of operationalizing a variable, so basically two different modells and i am supposed to compare the coefficients to see if they they are similar. This is the command i am was told to use.

    reg av uv if wave==1
    est sto compare1
    reg av uv if wave==0
    est sto compare2
    suest compare1 compare2
    test [compare1]uv=[compare2]uv

    This is my output (rollenbild is the variable). My professor told me that the output will only be the sigificance. Now I dont really know how to interpret the whole output and what this means for my model. Can someone help? I am also thankful if someone has literatur on that topic or knows where i can find the answer because i couldnt find it anywhere. --------------------------------------------------------------------------------
    | Robust
    | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    compare1_mean |
    rollenbild | .2413509 .0298794 8.08 0.000 .1827883 .2999135
    _cons | .7316354 .0248671 29.42 0.000 .6828967 .780374
    ---------------+----------------------------------------------------------------
    compare1_lnvar |
    _cons | .2346791 .0465184 5.04 0.000 .1435047 .3258535
    ---------------+----------------------------------------------------------------
    compare2_mean |
    rollenbild | -.0551894 .031637 -1.74 0.081 -.1171968 .006818
    _cons | .9364011 .0253071 37.00 0.000 .8868 .9860022
    ---------------+----------------------------------------------------------------
    compare2_lnvar |
    _cons | .5572786 .034583 16.11 0.000 .4894971 .6250601
    --------------------------------------------------------------------------------


    Thank You!



  • #2
    I don't see how this is comparing the same variable that is encoded/or derived in two ways, because your regression commands appear to be run on distinct subsets. Why not put this into a unified regression model using an interaction between wave and uv and then testing the interaction? A significant interaction term would then tell you if the effects of uv are different between waves.

    Something like this would work (though untested)

    Code:
    regress c.av##i.wave
    test av#wave 
    // read the documentation for test, I don't quite remember the correct syntax

    Comment


    • #3
      Ok Thank you!

      But do you know what the command is supposed to test? Mabye I missunderstood something.

      Comment


      • #4
        Sarah, as a sidelight, read the Statalist FAQ, especially point 12 on posting questions effectively. As is your output is extremely difficult to read and would be much clearer if you used code tags.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 16.0MP (2 processor)

        EMAIL: rwilliam@ND.Edu
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Originally posted by Sarah Weissmann View Post
          Ok Thank you!

          But do you know what the command is supposed to test? Mabye I missunderstood something.
          Say you fit the follow toy regression model

          Code:
          . sysuse auto
          . reg price c.displacement##i.foreign
          
                Source |       SS           df       MS      Number of obs   =        74
          -------------+----------------------------------   F(3, 70)        =     24.95
                 Model |   328157405         3   109385802   Prob > F        =    0.0000
              Residual |   306907991        70  4384399.87   R-squared       =    0.5167
          -------------+----------------------------------   Adj R-squared   =    0.4960
                 Total |   635065396        73  8699525.97   Root MSE        =    2093.9
          
          ----------------------------------------------------------------------------------------
                           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -----------------------+----------------------------------------------------------------
                    displacement |   24.99366    3.43882     7.27   0.000     18.13515    31.85217
                                 |
                         foreign |
                        Foreign  |  -3356.925   2258.762    -1.49   0.142    -7861.883    1148.033
                                 |
          foreign#c.displacement |
                        Foreign  |   60.51136   18.68396     3.24   0.002     23.24737    97.77535
                                 |
                           _cons |   231.1169   854.5385     0.27   0.788    -1473.206     1935.44
          ----------------------------------------------------------------------------------------
          This model fits an interaction effect between engine displacement and foreign make of car. The term I've highlighted in green is the interaction between displacement and foreign make. You can see how Stata names these terms, internally, by issuing the following command to request the coefficient legend.

          Code:
          . regress, coeflegend
          
          <output omitted>
          ----------------------------------------------------------------------------------------
                           price |      Coef.  Legend
          -----------------------+----------------------------------------------------------------
                    displacement |   24.99366  _b[displacement]
                                 |
                         foreign |
                        Foreign  |  -3356.925  _b[1.foreign]
                                 |
          foreign#c.displacement |
                        Foreign |   60.51136  _b[1.foreign#c.displacement]
                                 |
                           _cons |   231.1169  _b[_cons]
          ----------------------------------------------------------------------------------------
          Now you can see that the name for this interaction coefficient is -_b[1.foreign#c.displacement]-. You can test the (linear) hypothesis that this term is equal to 0 with -test-, giving you an apporpriate F-statistic. Alternatively, you can use -lincom- for the same hypothesis that the coefficient is equal to 0.

          Code:
          . test 1.foreign#c.displacement   // Note that the coefficient name does not include the _b[ and ]
          
           ( 1)  1.foreign#c.displacement = 0
          
                 F(  1,    70) =   10.49
                      Prob > F =    0.0018
          
          . lincom _b[1.foreign#c.displacement]    // Note that the coefficient name does includes _b[ and ]
          
           ( 1)  1.foreign#c.displacement = 0
          
          ------------------------------------------------------------------------------
                 price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   (1) |   60.51136   18.68396     3.24   0.002     23.24737    97.77535
          ------------------------------------------------------------------------------
          Now why test the interaction? It will tell you whether there is an additive effect of diplacement and make (no interaction) or if there is an additional effect (interaction effect) that cannot be explained by the sum of just those two variables. A more visual intuition would be to test if the regression line for the make==0 subset and for the make==1 subset have different slopes as compared to parallel slopes (the null hypothesis of no interaction effect).

          Comment


          • #6
            As an addition to Leonardo's helpful suggestions, the tests mentioned above:
            Code:
            test 1.foreign#c.displacement
            lincom _b[1.foreign#c.displacement]
            take the coefficient of displacement (for domestic cars) as 0. They therefore give you the same test as is already done in the regression output itself for the foreign#c.displacement coefficient. This tells you whether the additional effect of displacement on price for foreign cars is different from the effect of displacement on price for domestic cars.

            To check whether the total effect of displacement on price for foreign cars is different from zero, you have to add up the coefficients:
            Code:
            . qui reg price c.displacement##i.foreign
            
            . lincom _b[displacement] + _b[1.foreign#c.displacement]
            
             ( 1)  displacement + 1.foreign#c.displacement = 0
            
            ------------------------------------------------------------------------------
                   price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                     (1) |   85.50502   18.36478     4.66   0.000     48.87762    122.1324
            ------------------------------------------------------------------------------
            Or, alternatively:
            Code:
            . margins foreign, dydx(displacement)
            
            Average marginal effects                        Number of obs     =         74
            Model VCE    : OLS
            
            Expression   : Linear prediction, predict()
            dy/dx w.r.t. : displacement
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            displacement |
                 foreign |
               Domestic  |   24.99366    3.43882     7.27   0.000     18.13515    31.85217
                Foreign  |   85.50502   18.36478     4.66   0.000     48.87762    122.1324
            ------------------------------------------------------------------------------

            Comment

            Working...
            X