[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Clustered standard errors in -xtreg- with dfadj

From   "Lisa M. Powell" <>
Subject   st: Clustered standard errors in -xtreg- with dfadj
Date   Sun, 08 Mar 2009 09:34:29 -0500

Dear List members,

I would like to follow up on some of your email exchanges (see email exchange at the
bottom of this email) regarding the inclusion
of the dfadj command when clustering standard errors in an FE panel model.

I have an unbalanced sample of individuals over 4 waves of data. I
include county level variables in the analyses which are my key
variables of interest and I would like to cluster on the county id.
Given that individuals can move over time, they are not fully nested
within the clusters (the counties).

In STATA 10, if I try to run: xtreg outcome $econ5, i(caseid)
vce(cluster fip) fe;
then I get the message of: panels are not nested within clusters r(498);
which is indeed the case.

I gather that in earlier version of STATA such as 8.0 where one did
not have to specify nonest using the cluster command even when the
panels were not nested that STATA as the default implemented dfadj ? Is
that correct?

Therefore, I have added the option "nonest".
(xtreg outcome $econ5, i(caseid) vce(cluster fip) nonest fe)

If I additionally add the option "dfadj" then as expected my standard errors increase.
(xtreg outcome $econ5, i(caseid) vce(cluster fip) nonest dfadj fe)

In another post, a few years ago, Mark Schaffer responded as follows which was very helpful:
The problem arises when the panels cut across clusters. Some dof adjustment is needed, but what should it be? I don't know, and I haven't seen any paper that describes exactly what it should be. When writing -xtivreg2-, I opted simply for the program to exit with error. Official -xtivreg- now has the -nonest- and -dfadj- options; these didn't exist when I wrote -xtivreg2-. You'll see that they allow you to go between the extremes of no dof adjustment (which will give you SEs that are too small) and a full dof adjustment (which will give you "conservative" SEs that are on the large side).

My question now:  Is there a "partial" adjustment that can be done?

Alternatively, is there a way to bootstrap the standard errors to account for the non-nested county clusters?
Any further advice that you could offer would be much appreciated.

many thanks,

*From*  "Schaffer, Mark E" <
*To*    <
*Subject*       RE: st: Clustered standard errors in -xtreg-
*Date*  Thu, 28 Dec 2006 13:55:02 -0000



-----Original Message-----
[] On Behalf Of
Thomas Corneli?en
Sent: 28 December 2006 12:29
Subject: Re: st: Clustered standard errors in -xtreg-

> Thomas Cornelissen wrote:

> >> I am comparing two different ways of estimating a linear
> >> fixed-effects
> >> model:
> >>
> >> Method 1: Use -regress- and include dummy variables for the panels.
> >> Method 2: Use -xtreg, fe-.
> >>
> >> These two deliver exactly the same estimates of coefficients and
> >> their standard errors (if I do not cluster the standard errors).
> >>
> >> However, if I use the option -cluster- in order to get clustered
> >> standard errors (clustered on the panel ID), I get different
> >> results with the two ways of estimating the model.
> >>
> >> Why is this ?


Is there a rationale for not counting the absorbed regressors
when standard errors are clustered ?

Haven't degrees of freedom been used for absorbing the
variables and therefore the absorbed regressors should always
be counted as well?

The short answer to your first question is "yes" - you don't have to include the number of absorbed regressors in a degrees of freedom adjustment for the cluster-robust covariance estimator. The slightly longer answer is to appeal to authority, e.g., Wooldridge's 2002 textbook. The cluster-robust covariance estimator is given in eqn. 10.59 on p. 275, and you will see there is no dof adjustment. The standard covariance estimator is discussed on pp. 271-2, and the dof adjustment is given explicit attention.

This is why the more recent versions of Stata's official -xtreg- have the -nonest- and -dfadj- options for fixed effects estimation.

-nonest- relates to nesting panels within clusters; the cluster-robust cov estimator doesn't require a dof adjustment but only if panels are nested within clusters. If panels are not nested within clusters, then some kind of dof adjustment is needed.

-dfadj- will impose the full dof adjustment on the cluster-robust cov estimator. If panels are nested within clusters, then you would never need to use this. But since some kind of dof adjustment is needed if panels are not nested within clusters, you can use this option to go all the way and impose the full dof adjustment.


Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3296

Lisa M. Powell, PhD
Research Associate Professor
Senior Research Scientist
Institute for Health Research and Policy
University of Illinois at Chicago
tel: 312-413-8468
fax: 312-996-0065
*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index