Is there a way to cluster standard errors for seemingly unrelated regression (SUR) in R?

21 Views Asked by At

I am working on an econometric analysis involving seemingly unrelated regressions (SUR) in R, specifically using the systemfit package to estimate multiple regression equations that may have correlated error terms. My analysis requires clustering standard errors at a specific level (e.g., individual or group level) to account for within-group correlation. I am aware that some packages, like lmtest and sandwich, offer functionalities for robust standard errors and clustering in linear models, but I'm struggling to find a straightforward way to apply these or similar methods to SUR models fitted with systemfit. Does anyone know of a method or workaround in R for clustering standard errors in the context of SUR? Any guidance on packages or custom functions that could facilitate this would be greatly appreciated.

I attempted to use the systemfit package to fit SUR models and then apply clustered standard errors post-estimation. I expected to be able to use the vcovHC function from the sandwich package, similar to how one might with lm models, to compute robust standard errors that are clustered by a specific variable (e.g., participant_id). Specifically, I used:

fit \<- systemfit(list(eq1 = Y1 \~ X1, eq2 = Y2 \~ X2), method = "SUR", data = list(df1, df2))
clust_cov \<- vcovHC(fit, type = "HC1", cluster = \~ participant_id)

However, this approach resulted in errors indicating that vcovHC does not accept a systemfit model object with a cluster argument in the way I attempted. I was looking for a direct or workaround method to achieve clustering of standard errors at the subject level within the SUR framework provided by systemfit.

0

There are 0 best solutions below