Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: RE: xtivreg2 vs ivregress 2sls with cluster: missing SEs

From   "Schaffer, Mark E" <>
To   "" <>
Subject   st: RE: xtivreg2 vs ivregress 2sls with cluster: missing SEs
Date   Fri, 18 Oct 2013 09:42:47 +0000


It's a bit hard to tell based on the information you've provided (you should say which version of Stata you're using, which version of xtivreg2, etc., and a sample of the output would also help) but my guess is that you have run into a combination of the "VCV not full rank" issue and the "I'm trying to invert a gigantic matrix" issue.

The cluster-robust covariance matrix has rank = min(#columns, #clusters).  When you use your 2,000 dummies (your fixed effects), your covariance matrix will have over 2,000 columns, but the rank will be only 40 (the number of clusters).  So it's not full rank.

The second issue is that you have a huge number of regressors (over 2,000) and an explicit LSDV (least-squares dummy variables) estimation is likely to run into numerical accuracy issues.

If you *really* want to run the first stage with all 2,000 dummies and see what the SEs are, then the simplest thing to do is to run it by hand using -regress- instead of asking -ivregress- to do it for you.


> -----Original Message-----
> From: [mailto:owner-
>] On Behalf Of Francesco Amodio
> Sent: 18 October 2013 08:33
> To: statalist
> Subject: st: xtivreg2 vs ivregress 2sls with cluster: missing SEs
> Hi all,
> I am implementing an IV strategy where I instrument one endogenous
> regressor with two instruments. I also have a large set of dummies
> (2,000) as exogenous regressors. I cluster standard errors by categories (40)
> which encompass those defined by the dummy regressors.
> Having a large number of dummies, I use the 'xtivreg2' command with the 'fe'
> option. I was thus interested in checking that my results using the 'xtivreg2'
> commands where the same as the ones I obtain using 'xi: ivregress 2sls'.
> First and second stage point estimates of the variables of interest are exactly
> the same. However, when using 'ivregress 2sls' and the clustering option,
> STATA is unable to produce standard errors for my estimates in the first stage
> regression. That does not happen when I do not cluster SEs.
> Any hint on what is going on with missing SEs in the first stage regression?
> Thank you very much.
> --
> Francesco Amodio
> GPEFM - Departament d'Economia i Empresa Universitat Pompeu Fabra
> Ramon Trias Fargas 25-27 - 08005 Barcelona - Spain
> *
> *   For searches and help try:
> *
> *
> *

Sunday Times Scottish University of the Year 2011-2013
Top in the UK for student experience
Fourth university in the UK and top in Scotland (National Student Survey 2012)

We invite research leaders and ambitious early career researchers to 
join us in leading and driving research in key inter-disciplinary themes. 
Please see for further information and how
to apply.

Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index