grantmcdermott / etwfe

Extended two-way fixed effects
https://grantmcdermott.com/etwfe/
Other
50 stars 11 forks source link

Including weights? #42

Closed cjsewall9 closed 10 months ago

cjsewall9 commented 11 months ago

Is it possible to include weights in the etwfe function?

grantmcdermott commented 10 months ago

Yes, just use fixest's weights = ~weight_var arg syntax:

data("mpdta", package = "did")
modw = etwfe(
        fml  = lemp ~ 0, 
        tvar = year, 
        gvar = first.treat, 
        data = mpdta,   
        vcov = ~countyreal,  
        weights = ~lpop   # <- weighting variable
      )
emfx(modw)
# etc.

(Sorry for being slow with the reply. This issue slipped through the email cracks.)