title: Run a within estimation with time dummies in R
body: <p>I have a survey made of 13k observations: the dataset in an unbalanced panel based on a survey conducted every two years. 
  The df is based on individual observations from 2010 to 2014.</p>
  
  <p>I wanted to run a two ways fixed effect regression and I used these commands:</p>
  
  <pre><code>df &lt;- plm.data(d.d, c("id", "year")
  eq &lt;- plm(Y ~ X, data=df, model="within", effect="twoways") 
  </code></pre>
  
  <p>where id is the individual variable, year is time variable, Y is a binary dependent variable and X is the matrix of regressors (for the sake of simplicity I omitted the original regressors; in the original model there are demographic and economic variables). Since the command takes a lot of time to run a twoway regression, I tried another way.</p>
  
  <p>I tried to run a twoway regression using dummies: I could introduce n-1 time dummies (year 2012 and year 2014; year 2010 is omitted), but I couldn't do the same for individual observations since the df is composed by thousands of observations. </p>
  
  <p>Since the within estimation drops time invariant variables I thought that using a wihtin estimation with time dummies could be a solution. Is it right or it's just a big mistake?</p>
  
  <p>The command is this one:</p>
  
  <pre><code>df$year &lt;- as.factor(df$year)
  levels(df$year)
  "2010" "2012" "2014"
  
  eq &lt;- plm(Y ~ X + year, model="wihtin", data=df)
  </code></pre>
  
  <p>Thanks in advance</p>