Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Flagging estimation errors in -ivreg2-

From   "Schaffer, Mark E" <>
To   <>
Subject   st: RE: Flagging estimation errors in -ivreg2-
Date   Sun, 18 Feb 2007 23:05:49 -0000

Hi all.  This didn't go through the first time ... hopefully it's not too late to be useful to Mike.

> -----Original Message-----
> From: Schaffer, Mark E 
> Sent: 14 February 2007 08:39
> To:
> Subject: AW: Flagging estimation errors in -ivreg2-
> Mike,
> If -ivreg2- finds collinearities, it saves two versions of 
> assorted varlists (included exogenous, excluded exogenous, 
> etc etc) in the list of e() macros.  One version is the 
> original varlist specified by the user, with every variable 
> there.  The other version (same name but ending with a 1) is 
> the varlist after the collinear variables have been dropped.
> If -ivreg2- doesn't find any collinearities, then only the 
> first version of the e() macros is there.
> So... for your case (1) you should be able to flag whether or 
> collinearities were found by whether or not the e() macros 
> ending in 1 are present.  I think these are all listed in the
> -ivreg2- help file, along with a description of what they are.
> For case (2), this could be flagged by whether or not the 
> e(j) statistic is missing, since, as the error message 
> indicates, when you have the problem, the overid stat isn't 
> reported.  But this works only if you are estimating 
> overidentified models.
> HTH,
> Mark
> -----Ursprüngliche Nachricht-----
> Von: im Auftrag von 
> Michael S. Hanson
> Gesendet: So 2/11/2007 7:40
> An:
> Betreff: st: Flagging estimation errors in -ivreg2-
> 	I have a do file that uses a lengthy set of nested 
> loops to automate estimation of a large set of regressions 
> using -ivreg2-, and iteratively build up a summary report.  
> The -ivreg2- commands are  
> executed -quietly- and -capture-d to facilitate building the 
> tables.   
> Spot-checking a few individual estimations, I discovered that 
> two problems that have silently occurred:
> 	1. Some regressors are dropped to perfect collinearity. 
>  (This colinearity is not trivial, such as two identical 
> regressors or a set of dummies reproducing the constant;  
> hence such regressions are very difficult to identify ex ante.)
> 	2. The VCV matrix fails a rank condition;  the error 
> message displayed on the screen when estimated -noisily- is 
> below.  (In my application, the "covariance matrix uses too 
> many lags" may be the statistical source of the problem 
> (still investigating), but the specified equations are 
> theoretically sound.)
> "Error: estimated covariance matrix of moment conditions not 
> of full rank;
>         overidentification statistic not reported, and 
> standard errors and
>         model tests should be interpreted with caution.
> "Possible causes:
>         covariance matrix of moment conditions not positive definite
>         covariance matrix uses too many lags
>         singleton dummy variable (dummy with one 1 and N-1 0s 
> or vice versa)"
> Note that -capture- still returns _rc = 0 in either of these 
> cases -- after all, some kind of estimates are reported by 
> -ivreg2- -- so that does not appear to be a feasible way to 
> "flag" these potentially problematic estimation results.  
> What I am looking for is some other way to determine that one 
> (or both) of these errors has arisen with - ivreg2-, and 
> thereby "flag" the output in the summary report so that I can 
> go back and examine the small number (out of hundreds or
> thousands) of cases that may suffer from either issue.
> 	Any suggestions would be appreciated.
>                                          -- Mike
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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