Announcement

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

  • Test Differences After Margins dydx

    Dear all, I am estimating the following regression

    Code:
    reghdfe SPREAD_Haupttest_mean i.mgr_exclude##c.NUMEST FRQ_MJM_V1 VOLA_Haupttest BTM SIZE LOSS TURNOVER_Haupttest_mean IMR6, absorb (FYQ INDUSTRY) vce (cluster gvkey)
    The variable mgr_exclude is a binary one that takes the value 0 or 1. NUMEST is continous.

    After running the regression, i want to see the marginal effects of mgr_exclude=1 in the cases that the variable NUMEST takes the values 25th, 50th and 75th percentile. moreover, and most importantly, i want check if the difference between the value in the 25th and the 75th percentile is significant. so i did the following

    Code:
    margins, dydx(mgr_exclude) at(NUMEST=(1.386294 1.94591 2.564949)) post
    that part worked well. however, if i try to test the differences, i use
    Code:
    test _b[1._at] = _b[3._at]
    but the result is


    ( 1) [0b.mgr_exclude]1bno._at - [0b.mgr_exclude]3o._at = 0
    Constraint 1 dropped

    chi2( 0) = .
    Prob > chi2 = .


    can you help me out? thanks!
    Last edited by Nik Honig; 07 Jun 2024, 02:48.

  • #2
    Maybe this clarifies my problem:

    Code:
     margins, dydx(mgr_exclude) at(NUMEST=(1.386294 1.94591 2.564949)) post
    
    Average marginal effects                                Number of obs = 55,176
    Model VCE: Robust
    
    Expression: Linear prediction, predict()
    dy/dx wrt:  1.mgr_exclude
    1._at: NUMEST = 1.386294
    2._at: NUMEST =  1.94591
    3._at: NUMEST = 2.564949
    
    --------------------------------------------------------------------------------
                   |            Delta-method
                   |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
    ---------------+----------------------------------------------------------------
    0.mgr_exclude  |  (base outcome)
    ---------------+----------------------------------------------------------------
    1.mgr_exclude  |
               _at |
                1  |  -.1288038   .0172916    -7.45   0.000    -.1626947    -.094913
                2  |  -.0820267   .0151147    -5.43   0.000     -.111651   -.0524025
                3  |  -.0302826   .0188077    -1.61   0.107    -.0671449    .0065798
    --------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . test _b[1._at] = _b[3._at]
    
     ( 1)  [0b.mgr_exclude]1bno._at - [0b.mgr_exclude]3o._at = 0
           Constraint 1 dropped
    
               chi2(  0) =       .
             Prob > chi2 =         .
    
    .

    Comment


    • #3
      You are testing differences across the base level coefficients, which all take the values zero. Use the -coeflabel- option to see how to refer to the non-base level equation.

      Code:
      test [1.mgr_exclude]1._at = [1.mgr_exclude]3._at

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        Use the -coeflabel- option to see how to refer to the non-base level equation.
        Read -coeflegend- for "coeflabel".

        Comment

        Working...
        X