grantmcdermott / etwfe

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

Including weights? #42

Closed cjsewall9 closed 1 year ago

cjsewall9 commented 1 year ago

Is it possible to include weights in the etwfe function?

grantmcdermott commented 1 year 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.)