6

I am running a fixed effects panel regression use the PanelOLS() function in linearmodels 4.5.

While trying to add the 'entity_effects=True' and 'time_effects=True' in the model estimation, it returned 'AbsorbingEffectError':

The model cannot be estimated. The included effects have fully absorbed one or more of the variables. This occurs when one or more of the dependent variable is perfectly explained using the effects included in the model.

How can I fix the 'AbsorbingEffectError'?

panel = panel.set_index(['firm', 'Date'])  
exog_vars = panel[['ex_mkt', 'MV', 'ROA', 'BTM','leverage','2nd']]
exog = sm.add_constant(exog_vars)
y = panel[['ex_firm']]
model = PanelOLS(y, exog_vars,entity_effects=True).fit(cov_type='clustered', cluster_entity=True)

I am following the exact same steps as the example of the Fixed Effects model from the documentationhttps://bashtage.github.io/linearmodels/doc/panel/examples/examples.html#

G.mc
  • 123
  • 2
  • 10
  • did you find a solution? I'm having the same issue – TiTo May 13 '20 at 12:29
  • Unfortunately, nope, I switched to use Stata which can handle this issue. – G.mc May 16 '20 at 11:13
  • Are you sure it does not raise an omitted variable error in the regression output? That's what happened to me with Stata. I did not have enough within variation in my data so that I had to drop the variable. – TiTo May 16 '20 at 17:01
  • Then that would due to your model specification, and you might need to revise your model setting – G.mc Jul 11 '20 at 12:52

1 Answers1

0

I think G.mc and TiTo have a good point and I had the same issue today. It appears that if you have a 'constant' variable (which means no variation), then this problem appears in python. I tried as well in stata, and it seems to work even though constants are included. By constant I mean the usual 'c' introduced in the analysis and any other variable which in fact is static over the time period.

drops
  • 1,524
  • 1
  • 11
  • 20