# Clustering errors in Panel Data at the ID level and testing its necessity

What are the possible problems, regarding the estimation of your standard errors, when you cluster the standard errors at the ID level? And how does one test the necessity of clustered errors?

When you have panel data, with an ID for each unit repeating over time, and you run a pooled OLS in Stata, such as:

reg y x1 x2 z1 z2 i.id, cluster(id)


Or a fixed-effects model:

xtreg y x1 x2 z1 z2, fe cluster(id)


How does one test the accuracy of using clustered errors?

• In a FE model where you have $y_{it}=x'\beta + \alpha_{i}+\varepsilon_{it}$, $\rho$ is the share of the estimated variance of the overall error accounted for by the individual effect $\alpha_i$, or $\frac{\sigma_{\alpha}^2}{\sigma_{\alpha}^2+\sigma_{\varepsilon}^2}$. Clustering is about $Cov(\varepsilon_{it},\varepsilon_{it'}) \ne 0$. Could you elaborate on why $\rho$ reveals anything about the need to cluster? Commented Oct 28, 2015 at 1:20
• I have read the RBS book, but I cannot find a discussion of why you can interpret $\rho$ this way. From Cameron, Miller, and Gelbach's JBES paper, I thought that when the primary source of clustering is due to group-level common shocks, a useful approximation is that the OLS standard errors for variable $x$ from ignoring the clustering are inflated by factor $1 + \rho_{x} \cdot \rho_u \cdot (\bar N_g − 1),$ Commented Oct 28, 2015 at 18:41
• where $\rho_{x}$ is the within cluster correlation of x, $\rho_{u}$ is the within cluster error correlation, and $\bar N_g$ is the average cluster size. Thus it seems that the $\rho$ reported by Stata is not sufficient to determine that errors are off. Commented Oct 28, 2015 at 18:41