title: Heteroscedasticity robust standard errors with the PLM package
body: <p>I am trying to learn R after using Stata and I must say that I love it. But now I am having some trouble. I am about to do some multiple regressions with Panel Data so I am using the <code>plm</code> package.</p>
  
  <p>Now I want to have the same results with <code>plm</code> in R as when I use the <code>lm</code> function and Stata when I perform a heteroscedasticity robust and entity fixed regression.</p>
  
  <p>Let's say that I have a panel dataset with the variables <code>Y</code>, <code>ENTITY</code>, <code>TIME</code>, <code>V1</code>.</p>
  
  <p>I get the same standard errors in R with this code</p>
  
  <pre><code>lm.model&lt;-lm(Y ~ V1 + factor(ENTITY), data=data)
  coeftest(lm.model, vcov.=vcovHC(lm.model, type="HC1))
  </code></pre>
  
  <p>as when I perform this regression in Stata </p>
  
  <pre><code>xi: reg Y V1 i.ENTITY, robust
  </code></pre>
  
  <p>But when I perform this regression with the <code>plm</code> package I get other standard errors</p>
  
  <pre><code>plm.model&lt;-plm(Y ~ V1 , index=C("ENTITY","YEAR"), model="within", effect="individual", data=data)
  coeftest(plm.model, vcov.=vcovHC(plm.model, type="HC1))
  </code></pre>
  
  <ul>
  <li>Have I missed setting some options?</li>
  <li>Does the <code>plm</code> model use some other kind of estimation and if so how?</li>
  <li>Can I in some way have the same standard errors with <code>plm</code> as in Stata with <code>, robust</code> </li>
  </ul>