Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to estimates autocorrelation-consistent standard errors while clustering at a higher level

    Hello,

    I have a panel data. The observations is the GDP data for provinces in different countries in different years
    Code:
    xtset province year
    Due to the serial correlation, I try to use the "ivreghdfe" to get the autocorrelation-consistent standard error. The regression code is as follows:
    Code:
    ivreghdfe gdp x, cluster(province year) bw(2)
    However, many researchers suggest to cluster at coarsest level. Therefore, I try to use the following code to cluster at country level:
    Code:
    ivreghdfe gdp x, cluster(country year) bw(2)
    But I got the following error:
    Code:
     Error: cluster kernel-robust requires clustering on tsset panel & time vars.
    tsset panel var=gdlcode1; tsset time var=year; cluster vars=country1,year
    Is there any way to estimates autocorrelation-consistent standard errors while clustering at a higher level?

    Many thanks
Working...
X