Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: _rmcoll query


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: _rmcoll query
Date   Tue, 15 Feb 2005 21:36:10 -0000

. which _rmcoll 

confirms that -_rmcoll- is built-in. There 
is some documentation in [P] but I cannot 
confirm Roger's conjecture, although it 
does seem that is the way that -_rmcoll- 
might well be written. 

Nick 
n.j.cox@durham.ac.uk 

Roger Newson
 
> A query re -_rmcoll-. As I understand it, this is implemented at the 
> executable level. (At any rate, I cannot find a -_rmcoll.ado- 
> anywhere in 
> my c:\Stata8\ados\ path of my Windows 2000 system.) It is 
> therefore not 
> immediately obvious exactly how it chooses which of a set of 
> collinear 
> variables to drop. However, I get the impression (by 
> experimenting) that it 
> builds a list of non-collinear variables iteratively by 
> starting with an 
> empty list and iterating along the -varlist- of candidates 
> provided, from 
> the first variable to the last in the given order, testing at 
> each step 
> whether the latest candidate is a linear combination of the existing 
> non-collinear list, and adding the candidate to the list if 
> it isn't. In 
> "pidgin Stata", I get the impression that it works something 
> like as follows:
> 
> local ncvarlist ""
> foreach X of var `origvarlist' {
>    if islinearlydependent(`X' `ncvarlist') {
>      disp as text "Note: `X' dropped due to collinearity"
>    }
>    else {
>      local ncvarlist "`ncvarlist' `X'"
>    }
> }
> 
> where -ncvarlist- is the list of non-collinear variables 
> being assembled, 
> -origvarlist- is the original variable list provided, and 
> -islinearlydependent(varlist)- is a fantasy function 
> returning 1 if the 
> variables of -varlist- are linearly dependent and 0 
> otherwise. I get that 
> impression because, if I include 2 variables with identical 
> values in a 
> list of X-variables, then it is the second one that is 
> dropped, not the first.
> 
> Can I assume that, in general, this is how -_rmcoll- works? 
> And, if not, 
> then how does it work?

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index