Announcement

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

  • T test

    Hi, I want to compare the coefficient on one variable (i.e. IndVar) from the regressions based on two subsamples .

    reghdfe DepVar IndVar ControlVar Tone>Median, absorb(sic2 fyear) cluster(gvkey)
    reghdfe DepVar IndVar ControlVar Tone<Median, absorb(sic2 fyear) cluster(gvkey)

    I used the following code but it does not allow me to add the absorb and cluster functions when conducting the t-test.

    reghdfe DepVar IndVar ControlVar Tone>Median, absorb(sic2 fyear) cluster(gvkey)
    est store m1
    reghdfe DepVar IndVar ControlVar Tone<Median, absorb(sic2 fyear) cluster(gvkey)
    est store m2
    suest m1 m2
    test [m1_mean]IndVar = [m2_mean]IndVar

    Anyone knows how to solve this problem? Or is there other easier way to compare the coefficient on one variable from the regressions based on two subsamples?

  • #2
    Code:
    gen byte largetone = Tone > Median if Tone < .
    reghdfe DepVar i.largetone##(c.IndVar c.ControlVar) , absorb(sic2 fyear) cluster(gvkey)
    The test reported next to the interaction term between 1.largetone and lndVar is the test you are looking for.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thanks for the response!
      Just a few follow up questions.

      1. As an alternative method, can I use the following regression and look at the coefficient of the interaction term?
      reghdfe DepVar i.largetone (or any indicator variable used to identify subgroups)##c.IndVar ControlVar, absorb(sic2 fyear) cluster(gvkey)
      Does this regression aim to achieve different goals compared to the one you mentioned?


      2. If I want to run subsample regressions separately, such as the models below:
      reghdfe DepVar IndVar ControlVar if tone>median_tone, absorb(sic2 fyear) cluster(gvkey)
      reghdfe DepVar IndVar ControlVar if tone<median_tone, absorb(sic2 fyear) cluster(gvkey) Do I need to put the variable, tone, in these regressions as a control variable?

      Comment

      Working...
      X