Announcement

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

  • Compare coefficients from reghdfe model on two samples

    Hi all,

    I'm trying to compare beta coefficients from the same set of models applied to two different populations (e.g. male and female). My code looks something like:
    Code:
    eststo clear
     
    *run regressions on male subpopulation 
    reghdfe y x1 if female == 0, absorb(timevar) cluster(personvar)
    eststo a0
    
    reghdfe y x1 x2 if female == 0, absorb(timevar) cluster(personvar)
    eststo b0
    
    reghdfe y x1 x2 x3 if female == 0, absorb(timevar) cluster(personvar)
    eststo c0
    
    *run regressions on female subpopulation 
    reghdfe y x1 if female == 1, absorb(timevar) cluster(personvar)
    eststo a1
    
    reghdfe y x1 x2 if female == 1, absorb(timevar) cluster(personvar)
    eststo b1
    
    reghdfe y x1 x2 x3 if female == 1, absorb(timevar) cluster(personvar)
    eststo c1
    Then I want to compare a0 to a1, b0 to b1, and c0 to c1, and ideally output these comparisons into a latex table.

    I tried using -suest- but it seems incompatible with reghdfe. Any help would be appreciated!

  • #2
    I think you want to be using -esttab-.

    Code:
     eststo clear  
    
    *run regressions on male subpopulation  
    reghdfe y x1 if female == 0, absorb(timevar) cluster(personvar)
    eststo a0  
    
    reghdfe y x1 x2 if female == 0, absorb(timevar) cluster(personvar)
    eststo b0  
    
    reghdfe y x1 x2 x3 if female == 0, absorb(timevar) cluster(personvar)
    eststo c0  
    
    *run regressions on female subpopulation  
    reghdfe y x1 if female == 1, absorb(timevar) cluster(personvar)
    eststo a1  
    
    reghdfe y x1 x2 if female == 1, absorb(timevar) cluster(personvar)
    eststo b1
    
     reghdfe y x1 x2 x3 if female == 1, absorb(timevar) cluster(personvar)
    eststo c1  
    
    esttab a0 b0 c0 a1 b1 c1 using "{OUTPUT_PATH}.tex", mgroups("Male" "Female", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) booktabs label
    See this thread for titles that span multiple columns https://www.statalist.org/forums/for...umns-in-esttab, as "Male" and "Female" do here.

    Comment


    • #3
      Here some options
      https://friosavila.github.io/chatgpt...023/index.html

      Comment


      • #4
        George, I'm not looking to output the regression results, which is what esttab does. I'm looking to formally compare regression results (statistically test whether they're different from one another) from a model applied to two different samples.

        Fernando, I think the link got close to an answer to my question. But unfortunately, it provides no examples such as the one I posted above: using reghdfe with the absorb and cluster options on two samples, and comparing the results...

        Comment


        • #5
          reghdfe is from https://github.com/sergiocorreia/ivreghdfe (FAQ Advice #12). See https://www.statalist.org/forums/for...erent-outcomes

          Comment


          • #6
            It is the same idea
            i do have only simplest case
            but if you have specific suggestions on how to add more info to my post, I’m glad to hear

            Comment

            Working...
            X