R: No way to get double-clustered standard errors for an object of class "c('pmg', 'panelmodel')"?
<p>I am estimating Fama-Macbeth regression. I have taken the code from this <a href="http://www.r-bloggers.com/fama-macbeth-and-cluster-robust-by-firm-and-time-standard-errors-in-r/" rel="nofollow noreferrer">site</a></p>
<pre><code>fpmg &lt;- pmg(Mumbo~Jumbo, test, index=c(&quot;year&quot;,&quot;firmid&quot;))
summary(fpmg)     
Mean Groups model   
Call:
pmg(formula = Mumbo ~ Jumbo, data = superfdf, index = c(&quot;day&quot;,&quot;Firm&quot;)) 

Residuals
 Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-0.142200 -0.006930  0.000000  0.000000  0.006093  0.142900
Coefficients
               Estimate  Std. Error z-value Pr(&gt;|z|)
(Intercept) -3.0114e-03  3.7080e-03 -0.8121   0.4167
Jumbo        4.9434e-05  3.4309e-04  0.1441   0.8854
Total Sum of Squares: 1.6915
Residual Sum of Squares: 0.86425
Multiple R-squared: 0.48908`
</code></pre>
<p>After estimating fpmg, I estimate robust SE with double-clustering:</p>
<pre><code>vcovDC &lt;- function(x, ...){
vcovHC(x, cluster=&quot;group&quot;, ...) + vcovHC(x, cluster=&quot;time&quot;, ...) - 
    vcovHC(x, method=&quot;white1&quot;, ...)}
coeftest(fpmg, vcov=function(x) vcovHC(x, cluster=&quot;group&quot;, type=&quot;HC1&quot;))
</code></pre>
<p>I get the following error:</p>
<pre><code>Error in UseMethod(&quot;estfun&quot;) : 
  no applicable method for 'estfun' applied to an object of class &quot;c('pmg', 'panelmodel')&quot;
</code></pre>
<p>Please suggest how to solve this error?</p>
<blockquote>
<p><strong>Update:</strong>
I have also tried &quot;multiwayvcov&quot; package but it shows the same error. It seems that the object class is not permitted in these packages(Sandwich, multiwayvcov etc.). It seems R essentially makes all my labour useless and I have hit the dead end. I have found how to do the above in python(I mean the code) but I have no knowledge of it.</p>
</blockquote>
<p><em><strong>Is there no way to solve the problem in R?</strong></em></p>
<hr />