Announcement

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

  • Compare coefficients using reghdfe

    Hi,

    For an analysis, I want to compare the coefficients between deciles in order to see if this effect changes over the deciles. I regress the Robinhood users on stock price volatility (RETX_sd_21days) and use four control variables (E_vol, asset, debt, and size). I use a fixed effect regression with the "reghdfe" command in stata. My fixed effect are dum_date (_n for every date) and dum_firm (_n for every firm). In order to cope with outliers in my dataset, I transformed the categorical data into deciles based on the daily basis. My regression (without without distinguishing between deciles) is:

    Code:
    reghdfe deciles_RETX_sd_21days deciles_Robinhood deciles_E_vol deciles_Asset_growth deciles_Long_term_debt deciles_Size, absorb(dum_date dum_TICKER) vce(cluster dum_date dum_TICKER)
    I divided each firm into one of the 10 decile (variable decile_10) (1 - 10) based on the amount of Robinhood users. I can run a regression for each decile, however, I don't know how to compare these two coefficients. I placed an example below where I regress the results for decile 1 and decile 2. I know that, in this case, both coefficients (deciles_robin) are not significant, however, I want to compare this with a significance test (and also for the other deciles).

    I saw on statelist some forms who talked about using the interaction effect in order to compare the coefficients, however, I am not quite there yet.

    Code:
    reghdfe deciles_RETX_sd_21days deciles_Robinhood deciles_E_vol deciles_Asset_growth deciles_Long_term_debt deciles_Size if decile_10 ==1, absorb(dum_date dum_TICKER) vce(cluster dum_date dum_TICKER)
    (MWFE estimator converged in 6 iterations)
    Warning: VCV matrix was non-positive semi-definite; adjustment from Cameron, Gelbach & Miller applied.
    
    HDFE Linear regression                            Number of obs   =    183,715
    Absorbing 2 HDFE groups                           F(   5,    420) =       1.98
    Statistics robust to heteroskedasticity           Prob > F        =     0.0802
                                                      R-squared       =     0.4526
                                                      Adj R-squared   =     0.4496
    Number of clusters (dum_date) =        576        Within R-sq.    =     0.0019
    Number of clusters (dum_TICKER) =        421      Root MSE        =     1.8906
    
                         (Std. err. adjusted for 421 clusters in dum_date dum_TICKER)
    ---------------------------------------------------------------------------------
                    |               Robust
    deciles_R~1days | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    ----------------+----------------------------------------------------------------
    deciles_Robin~d |  -.0668751   .0939463    -0.71   0.477    -.2515387    .1177885
      deciles_E_vol |   .0936615   .1146207     0.82   0.414    -.1316401    .3189632
    deciles_Asset~h |  -.1963262    .126989    -1.55   0.123    -.4459394     .053287
    deciles_Long_~t |   .1923012   .0927918     2.07   0.039      .009907    .3746954
       deciles_Size |   .1618827   .1052835     1.54   0.125    -.0450655    .3688308
              _cons |    3.92085   .9381825     4.18   0.000     2.076732    5.764968
    ---------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
        dum_date |       576         576           0    *|
      dum_TICKER |       421         421           0    *|
    -----------------------------------------------------+
    * = FE nested within cluster; treated as redundant for DoF computation
    Code:
    . reghdfe deciles_RETX_sd_21days deciles_Robinhood deciles_E_vol deciles_Asset_growth deciles_Long_term_debt deciles_Size if decile_10 ==2, absorb(dum_date dum_TICKER) vce(cluster dum_date dum_TICKER)
    (MWFE estimator converged in 6 iterations)
    Warning: VCV matrix was non-positive semi-definite; adjustment from Cameron, Gelbach & Miller applied.
    
    HDFE Linear regression                            Number of obs   =    204,732
    Absorbing 2 HDFE groups                           F(   5,    421) =       6.09
    Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                      R-squared       =     0.4719
                                                      Adj R-squared   =     0.4693
    Number of clusters (dum_date) =        569        Within R-sq.    =     0.0052
    Number of clusters (dum_TICKER) =        422      Root MSE        =     1.8420
    
                         (Std. err. adjusted for 422 clusters in dum_date dum_TICKER)
    ---------------------------------------------------------------------------------
                    |               Robust
    deciles_R~1days | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    ----------------+----------------------------------------------------------------
    deciles_Robin~d |   .0860815   .0553911     1.55   0.121    -.0227961    .1949591
      deciles_E_vol |   .3656645    .114269     3.20   0.001     .1410557    .5902733
    deciles_Asset~h |  -.4207198   .1205098    -3.49   0.001    -.6575957   -.1838439
    deciles_Long_~t |  -.1190539   .1257359    -0.95   0.344    -.3662023    .1280945
       deciles_Size |   .0893299   .1185703     0.75   0.452    -.1437336    .3223934
              _cons |    5.31368   1.206879     4.40   0.000     2.941421     7.68594
    ---------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
        dum_date |       569         569           0    *|
      dum_TICKER |       422         422           0    *|
    -----------------------------------------------------+
    * = FE nested within cluster; treated as redundant for DoF computation
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long date str9 TICKER float(deciles_Robinhood deciles_RETX_sd_21days deciles_E_vol deciles_Asset_growth deciles_Long_term_debt deciles_Size dum_date dum_TICKER decile_10)
    21306 "A" 8 7 2 5 6 10   1 1 8
    21307 "A" 8 8 2 5 6 10   2 1 8
    21308 "A" 8 8 2 5 6 10   3 1 8
    21311 "A" 8 8 2 5 6 10   4 1 8
    21312 "A" 8 8 2 5 6 10   5 1 8
    21313 "A" 8 8 2 5 6 10   6 1 8
    21314 "A" 8 8 2 5 6 10   7 1 8
    21315 "A" 8 8 2 5 6 10   8 1 8
    21318 "A" 8 8 2 5 6 10   9 1 8
    21319 "A" 9 8 2 5 6 10  10 1 8
    21320 "A" 9 4 2 5 6 10  11 1 8
    21321 "A" 9 4 2 5 6 10  12 1 8
    21322 "A" 9 4 2 5 6 10  13 1 8
    21325 "A" 9 4 2 5 6 10  14 1 8
    21326 "A" 9 4 2 5 6 10  15 1 8
    21327 "A" 9 4 2 5 6 10  16 1 8
    21328 "A" 9 4 2 5 6 10  17 1 8
    21329 "A" 9 4 2 5 6 10  18 1 8
    21333 "A" 9 4 2 5 6 10  19 1 8
    21334 "A" 9 4 2 5 6 10  20 1 8
    21335 "A" 9 3 2 5 6 10  21 1 8
    21336 "A" 9 4 2 5 6 10  22 1 8
    21339 "A" 9 3 2 5 6 10  23 1 8
    21340 "A" 9 3 2 5 6 10  24 1 8
    21341 "A" 9 3 2 5 6 10  25 1 8
    21342 "A" 9 3 2 5 6 10  26 1 8
    21343 "A" 8 3 2 5 6 10  27 1 8
    21346 "A" 8 3 2 5 6 10  28 1 8
    21347 "A" 8 3 2 5 6 10  29 1 8
    21348 "A" 8 3 2 5 6 10  30 1 8
    21349 "A" 8 3 2 5 6 10  31 1 8
    21350 "A" 8 3 2 5 6 10  32 1 8
    21353 "A" 8 3 2 5 6 10  33 1 8
    21354 "A" 8 3 2 5 6 10  34 1 8
    21355 "A" 8 3 2 5 6 10  35 1 8
    21356 "A" 8 2 2 5 6 10  36 1 8
    21357 "A" 8 2 2 5 6 10  37 1 8
    21360 "A" 8 3 2 5 6 10  38 1 8
    21361 "A" 8 2 2 5 6 10  39 1 8
    21362 "A" 8 2 2 5 6 10  40 1 8
    21363 "A" 8 2 2 5 6 10  41 1 8
    21364 "A" 8 2 2 5 6 10  42 1 8
    21367 "A" 9 3 2 5 6 10  43 1 8
    21368 "A" 9 3 2 5 6 10  44 1 8
    21370 "A" 8 3 2 5 6 10  45 1 8
    21371 "A" 8 3 2 5 6 10  46 1 8
    21374 "A" 8 3 2 5 6 10  47 1 8
    21375 "A" 8 3 2 5 6 10  48 1 8
    21376 "A" 8 3 2 5 6 10  49 1 8
    21377 "A" 8 3 2 5 6 10  50 1 8
    21378 "A" 8 3 2 5 6 10  51 1 8
    21381 "A" 8 3 2 5 6 10  52 1 8
    21382 "A" 8 3 2 5 6 10  53 1 8
    21383 "A" 8 3 2 5 6 10  54 1 8
    21384 "A" 8 3 2 5 6 10  55 1 8
    21385 "A" 8 3 2 5 6 10  56 1 8
    21388 "A" 8 4 2 5 6 10  57 1 8
    21389 "A" 8 4 2 5 6 10  58 1 8
    21390 "A" 8 3 2 5 6 10  59 1 8
    21391 "A" 8 3 2 5 6 10  60 1 8
    21392 "A" 8 3 2 5 6 10  61 1 8
    21395 "A" 8 4 2 5 6 10  62 1 8
    21396 "A" 8 3 2 5 6 10  63 1 8
    21397 "A" 8 3 2 5 6 10  64 1 8
    21398 "A" 8 3 2 5 6 10  65 1 8
    21399 "A" 8 3 2 5 6 10  66 1 8
    21402 "A" 8 3 2 5 6 10  67 1 8
    21403 "A" 8 3 2 5 6 10  68 1 8
    21404 "A" 8 3 2 5 6 10  69 1 8
    21406 "A" 8 3 2 5 6 10  71 1 8
    21409 "A" 8 3 2 5 6 10  72 1 8
    21410 "A" 8 3 2 5 6 10  73 1 8
    21411 "A" 8 3 2 5 6 10  74 1 8
    21412 "A" 8 1 2 5 6 10  75 1 8
    21413 "A" 8 1 2 5 6 10  76 1 8
    21416 "A" 8 1 2 5 6 10  77 1 8
    21417 "A" 8 1 2 5 6 10  78 1 8
    21418 "A" 8 1 2 5 6 10  79 1 8
    21419 "A" 8 1 2 5 6 10  80 1 8
    21420 "A" 8 1 2 5 6 10  81 1 8
    21423 "A" 8 1 2 5 6 10  82 1 8
    21424 "A" 8 1 2 5 6 10  83 1 8
    21425 "A" 8 1 2 5 6 10  84 1 8
    21426 "A" 8 1 2 5 6 10  85 1 8
    21427 "A" 8 1 2 5 6 10  86 1 8
    21431 "A" 8 1 2 5 6 10  87 1 8
    21432 "A" 8 1 2 5 6 10  88 1 8
    21433 "A" 8 2 2 5 6 10  89 1 8
    21434 "A" 8 2 2 5 6 10  90 1 8
    21437 "A" 8 2 2 5 6 10  91 1 8
    21438 "A" 8 2 2 5 6 10  92 1 8
    21439 "A" 8 3 2 5 6 10  93 1 8
    21440 "A" 8 4 2 5 6 10  94 1 8
    21441 "A" 8 3 2 5 6 10  95 1 8
    21444 "A" 8 3 2 5 6 10  96 1 8
    21445 "A" 8 4 2 5 6 10  97 1 8
    21446 "A" 8 4 2 5 6 10  98 1 8
    21447 "A" 8 4 2 5 6 10  99 1 8
    21448 "A" 8 3 2 5 6 10 100 1 8
    21451 "A" 8 3 2 5 6 10 101 1 8
    end
    format %tdCCYY-NN-DD date

    I would appreciate your help!

    Kind regards,
    Fabien Keyzer

  • #2
    You can do this with an interaction model:

    Code:
    reghdfe deciles_RETX_sd_21days i.decile_10##c.deciles_Robinhood deciles_E_vol ///
        deciles_Asset_growth deciles_Long_term_debt deciles_Size if inlist(idecile_10, 1, 10), ///
        absorb(dum_date dum_TICKER) vce(cluster dum_date dum_TICKER)
    will give you the difference between the deciles_Robinhood slope in decile 1 and decile 10. It will appear in the output as the coefficient of 10.decile_10#c.deciles_Robinhood.

    I caution you not to assess this by looking at whether it is statistically significant. Your sample sizes are huge, and even very tiny differences that have no real world meaning at all could well turn out to be statistically significant. Judge, rather, whether that coefficient is large enough to matter in the real world. If it is, then take a look at the confidence interval and judge whether both ends of that confidence interval would also be large enough to matter in the real world. That's a judgment call, and there is no statistical test for it.

    Comment


    • #3
      Hi Clyde,

      Thanks for the code provided and the recommendation on how to interpret the results. I really appreciate it!

      With kind regards,
      Fabien

      Comment

      Working...
      X