title: categorical variable panel ols
body: <p>For my PanelOLS i like to include categorical variables. 
  This is my model:</p>
  
  <pre><code>import statsmodels.api as sm
  
  exog_vars = ['x1', 'x2', 'x3']
  exog = sm.add_constant(df[exog_vars])
  mod = PanelOLS(df.y, exog, entity_effects=True, time_effects=True)
  result = mod.fit(cov_type='clustered', cluster_entity=True)
  </code></pre>
  
  <p>The categorial variable is a number for a industry. This nummber is stored in my dataframe(<code>df['x4']</code>). 
  Do you know how to include categorical variables? Or do you need more information to answer the question.</p>
  
  <p>My dataframe:
  <a href="https://i.stack.imgur.com/NA0eq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NA0eq.png" alt="enter image description here"></a></p>
  
  <p>I tried:</p>
  
  <pre><code>df['x4'] = pd.Categorical(gesamt.x4)
  
  mod = PanelOLS(gesamt.CAR, exog, other_effects=df['x4'], entity_effects=True, time_effects=True)
  </code></pre>
  
  <p>The follwing error occured:</p>
  
  <blockquote>
  <pre><code>raise ValueError('At most two effects supported.')
  </code></pre>
    
    <p>ValueError: At most two effects supported.</p>
  </blockquote>