title: xtlogit in R - logit fixed effects
body: <p>I'm trying to figure out how to perform a fixed effect logit regression in R (analogously to Stata's xtlogit command). I read of several packages such as "pglm" or "bife" but couldn't get my model to run.</p>
  
  <p>My data is saved as a data frame and looks like:</p>
  
  <pre><code>ID   Time  Y  X
  1    2000  1  0
  1    2001  0  1
  1    2002  1  1
  ...
  1    2016  1  0
  ...
  n
  </code></pre>
  
  <p>Basically I would like to run the fixed effects logit regression:</p>
  
  <pre><code> y_jt = beta*x_jt + mu_j + pi_t + epsilon_jt
  </code></pre>
  
  <p>where j is the ID, t is the Time, mu the ID fixed effects, pi the time fixed effects, and epsilon the error term.</p>
  
  <p>I'm open to using any package. I started with "bife" but could not figure out how to set both ID and Time fixed effects. I tried:</p>
  
  <pre><code> mod.no &lt;- bife(y ~ x | ID, data = panel)
  </code></pre>
  
  <p>Do I maybe need to set the data as a panel like Stata's "xtset" command?</p>
  
  <p>Many thanks in advance!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The Stata command I would like to replicate in R is:</p>
  
  <pre><code>xi: xtlogit Y X i.Time, fe
  </code></pre>