Statalist The Stata Listserver


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

Re: st: RE: detecting a dropped variable programatically


From   Mark <[email protected]>
To   [email protected]
Subject   Re: st: RE: detecting a dropped variable programatically
Date   Sat, 20 May 2006 02:56:40 +0800

Thanks! This is just what I wanted. The other two solutions posted would work in other circumstances, but in this case, most of my regressions will not have dropped variables, and if one does, it is not something I can correct. So this seems to be the lightest weight test possible.

Mark

David Harrison wrote:

e(df_m) will tell you how many degrees of freedom your model has. If
this is less than the number of predictors (the columns of e(b) minus 1)
then something has been dropped.

David

-----Original Message-----

I am writing a program that runs through potentially tens of thousands
of regressions.  During this evaluation, I sometimes end up with
collinear variables.  (Not really, but very nearly collinear, and so
numerically stata ends up thinking they are.)  I know that I can look
thru the e(V) matrix looking for a value of zero on the diagonal.  But
doing this for every regression means another loop inside the main loop
that may run tens of thousands of times.

Does anyone know of a way to detect a dropped variable without a loop?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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