Skip to content

getfe reference level #52

@tappek

Description

@tappek

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions