title: R2 with plm package
body: <p>When estimating the pooled model using the plm package using this syntax I get an R2 that is nearly 0.8.</p>
  
  <pre><code>library(plm)
  data &lt;- employmentsez
  data$lfirms2 &lt;- data$lfirms*data$lfirms
  data$sezname &lt;- as.factor(data$sezname)
  data &lt;- plm.data(data, index=c("code", "year"))
  fit1 &lt;- plm(lemployment ~ lfirms + lfirms2 + lfirmsfor + lwages +  nuts51 + lgovgrants + leusubs + agrishare, data=data, model="pooling")
      R-Squared:      0.7972
      Adj. R-Squared: 0.79679
  </code></pre>
  
  <p>With the exact same specification and again with plm but now this syntax I get an R2 that is less than 0.1 and R2 adjusted is negative.</p>
  
  <pre><code>library(plm)
  data &lt;- employmentsez
  data$lfirms2 &lt;- data$lfirms*data$lfirms
  data$sezname &lt;- as.factor(data$sezname)
  data &lt;- plm.data(data, index=c("code", "year"))
  fit1 &lt;- plm(lemployment ~ lfirms + lfirms2 + lfirmsfor + lwages +  nuts51 + lgovgrants + leusubs + agrishare, data=data, model="within", effect="individual")
  summary(fit1)
  
  
      R-Squared:      0.085873
      Adj. R-Squared: -0.039652
  </code></pre>
  
  <p>I think the difference is too big and in Stata you get a higher R2 for the within model using the exact same specifications. Also ought the within model not give a higher R2 when using the exact same specification and adding the fixed effects?</p>
  
  <p>Does anyone know how to fix this problem, is there an alternative way to get the correct R2 with the plm package?</p>