Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You just need to look inside <code>plm:::summary.plm</code> to see what it is doing. When you do, you'll see that your two lines calling <code>summary()</code> on your model fit can be replaced with:</p> <pre><code>coefficients_estimated &lt;- coef(regression) ses_estimated &lt;- sqrt(diag(vcov(regression))) </code></pre> <p>For example:</p> <pre><code>require(plm) data("Produc", package = "plm") zz &lt;- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index = c("state","year")) </code></pre> <p><code>summary(zz)</code> gives:</p> <pre><code>&gt; summary(zz) Oneway (individual) effect Within Model .... Coefficients : Estimate Std. Error t-value Pr(&gt;|t|) log(pcap) -0.02614965 0.02900158 -0.9017 0.3675 log(pc) 0.29200693 0.02511967 11.6246 &lt; 2.2e-16 *** log(emp) 0.76815947 0.03009174 25.5273 &lt; 2.2e-16 *** unemp -0.00529774 0.00098873 -5.3582 1.114e-07 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 .... </code></pre> <p>and the two lines I showed return for <code>zz</code>:</p> <pre><code>&gt; coef(zz) log(pcap) log(pc) log(emp) unemp -0.026149654 0.292006925 0.768159473 -0.005297741 &gt; sqrt(diag(vcov(zz))) log(pcap) log(pc) log(emp) unemp 0.0290015755 0.0251196728 0.0300917394 0.0009887257 </code></pre> <p>You don't really provide enough information (your simulation code nor the full output from <code>Rprof()</code> for example) to say whether this will help - it certainly doesn't look like vast amounts of time are spent in <code>summary()</code>; <code>FUN</code> is far more costly than anything else you show, and of the elements you do show, <code>r.squared()</code> is the only one that appears in <code>plm:::summary.plm()</code> and it seems to take no time at all.</p> <p>So, whether the above speeds things up appreciably remains to be seen.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload