Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getfe reference level #52

Open
tappek opened this issue Aug 29, 2021 · 0 comments
Open

getfe reference level #52

tappek opened this issue Aug 29, 2021 · 0 comments

Comments

@tappek
Copy link

tappek commented Aug 29, 2021

It seems like getfe chooses the reference level for the fixed effects based on the pattern of unbalancedness if there is more than one fixed effect. This feels somewhat random to the end-user (seems like it is the first level with max observations).

A second thing I noticed about getfe is that the reference argument does not seems to be respected (if method != "kaczmarz").

See the examples below with comments (they are for IV models, but same applied to ordinary regression models).

data("Crime", package = "plm")
delrows.a <- -c(1,2,10,12)
delrows.b <- -c(9)

crime_formula_2SLS_tw <- lcrmrte ~ lprbconv + lprbpris + lavgsen + 
  ldensity + lwcon + lwtuc + lwtrd + lwfir +
  lwser + lwmfg + lwfed + lwsta + lwloc + lpctymle | 
  county + year |
  (lprbarr|lpolpc ~ ltaxpc + lmix)


FE2SLS_tw_unbal.felm.a <- lfe::felm(crime_formula_2SLS_tw, data = Crime[delrows.a, ])
FE2SLS_tw_unbal.felm.b <- lfe::felm(crime_formula_2SLS_tw, data = Crime[delrows.b, ])

getfe(FE2SLS_tw_unbal.felm.a) # year.84 is set to zero
getfe(FE2SLS_tw_unbal.felm.b) # year.81 is set to zero

# same for ef = "zm"
getfe(FE2SLS_tw_unbal.felm.a, ef = "zm") # year.84 is set to zero
getfe(FE2SLS_tw_unbal.felm.b, ef = "zm") # year.81 is set to zero


# arg references does not work with method != "kaczmarz"
getfe(FE2SLS_tw_unbal.felm.a, references = "year.81", method = "cg")
getfe(FE2SLS_tw_unbal.felm.a, references = "year.81", method = "cholesky")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant