[Gretl-users] Cluster option in ols not working with panel data

Allin Cottrell cottrell at wfu.edu
Fri Aug 2 12:30:21 EDT 2013


On Thu, 1 Aug 2013, Giuseppe Vittucci wrote:

> There is a bug in the option "cluster" for clustered standard errors in
> OLS estimates: they are not computed in panel data.
>
> This is a simple code to reproduce the issue:
>
> open greene14_1.gdt
> logs C Q PF LF
> series d = (unit <= 3)
> ols l_C 0 l_Q l_PF l_LF
> setobs unit year --panel-vars
> ols l_C 0 l_Q l_PF l_LF --cluster=d
> setobs 1 1
> ols l_C 0 l_Q l_PF l_LF --cluster=d
>
> The second and third estimates should give the same result.
> However, the s.e. in the second estimate are equal to the first one...

Thanks for the report. This should now be fixed in CVS and 
snapshots.

> Moreover, the same option cluster does not work and returns an error if
> there is at least one missing observation.

I cannot replicate that -- could you give an example? The 
following, for example, works correctly here:

<hansl>
open greene14_1.gdt
logs C Q PF LF
series d = (unit <= 3)
l_LF[10] = NA
ols l_C 0 l_Q l_PF l_LF --cluster=d
</hansl>

I can provoke an error if I specify a clustering variable that 
has a missing value for an observation where the regressand 
and regressors are not missing -- but that seems correct; you 
can't have an observation that belongs to an indeterminate 
cluster.

Allin Cottrell



More information about the Gretl-users mailing list