Skip to content
Prev 26904 / 29559 Next

Clustering Sd Error in Spatial Models.

Hello,

I am currently working on a project estimating a spatial panel model.
Because I also estimate non-spatial models I am computing the clustered
standard errors following Stock and Watson (2008).

I tried to do the same for my spatial models however I am running into the
some errors (depending if I bootstrap or not my clustered
variance-covariance matrix). Below is a reproducible example.


#### Example
+                   model="within", spatial.error="kkp")
Error in UseMethod("estfun") :
  no applicable method for 'estfun' applied to an object of class "splm"
Error in terms.default(x) : no terms component nor attribute
Error in terms.default(x) : no terms component nor attribute
Error in terms.default(x) : no terms component nor attributebute

#############
### Non spatial
library(lfe)

fe_cluster <- felm(log(gsp) ~ log(pcap) + log(pc) + log(emp) +
unemp|year+state|0|state,data=Produc)
Call:
   felm(formula = log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp |
year + state | 0 | state, data = Produc)

Residuals:
      Min        1Q    Median        3Q       Max
-0.160369 -0.018026 -0.000859  0.016745  0.170752

Coefficients:
           Estimate Cluster s.e. t value Pr(>|t|)
log(pcap) -0.030176     0.060042  -0.503   0.6154
log(pc)    0.168828     0.088331   1.911   0.0563 .
log(emp)   0.769306     0.087700   8.772   <2e-16 ***
unemp     -0.004221     0.003294  -1.281   0.2005
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
##########

My questions are:
1) Is it possible to cluster the variance-covariance matrix on spatial
models?
2) If so, what is the correct procedure?


Thank you for your help,
Amir
--
Amir B Ferreira Neto