Announcement

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

  • Compare model fit (AIC) after reghdfe

    Hello I am running two nested models using reghdfe, and I would like to compare model fit the two models are the following


    Code:
    *m1
    reghdfe y x, absorb(unit_fe time_fe) cluster(unit_fe)
    
    *m2
    reghdfe y x, absorb(unit_fe time_fe partner_fe) cluster(unit_fe)
    I tried calculating these by hand but using this command only generates missing values `gen aic1 = -2*e(ll) + 2*e(k)`

    Am I doing something wrong? Do you have any suggestions on how to compare model fit using reghdfe?

    thanks a lot for your help

  • #2
    estat ic

    after your run the model.

    Code:
    sysuse auto, clear
    
    reghdfe price mpg weight turn, absorb(rep78) cluster(rep78)
    estat ic
    di 2*(e(df_m)+1)-2*e(ll)
    
    reghdfe price mpg weight, absorb(rep78 foreign) cluster(rep78)
    estat ic
    di 2*(e(df_m)+1)-2*e(ll)


    Comment


    • #3
      Thank you this is amazing!

      Comment

      Working...
      X