title: Python: Two-way Fixed Effects without independent variable to estimate the residual
body: <p>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. </p>
  
  <p>y<sub>it</sub> = constant + α<sub>i</sub> + δ<sub>t</sub> + ε<sub>it</sub></p>
  
  <p>LogPrice = Constant + EntityEffects + TimeEffects + Error</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>from linearmodels import PanelOLS
  mod = PanelOLS.from_formula('LogPrice ~ 1 + EntityEffects + TimeEffects', data=data1)
  print(mod.fit())
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Could you help me to fix the problem, or do you know a work around? Many thanks in advance.</p>