Having a multiindex dataframe with the index1: shops, index2: DateTime, and column: LogPrice, I want to take the EntityEffects and TimeEffects out of the data by estimating the residuals of the fixed effects model.
yit = constant + αi + δt + εit
LogPrice = Constant + EntityEffects + TimeEffects + Error
I am using the following code:
from linearmodels import PanelOLS
mod = PanelOLS.from_formula('LogPrice ~ 1 + EntityEffects + TimeEffects', data=data1)
print(mod.fit())
I get this error:
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-
packages/linearmodels/iv/model.py", line 290
p1 = (x.T @ x) * (1 - kappa) + kappa * ((x.T @ z) @ (pinvz @ x))
^
SyntaxError: invalid syntax
Could you help me to fix the problem, or do you know a work around? Many thanks in advance.