Statalist


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

st: RE: Covariates in model


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Covariates in model
Date   Wed, 22 Jul 2009 17:55:52 +0100

Use -colnames- not -colfullnames-. 

Also note Maarten Buis' -indeplist- from SSC. 

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

Xu, Haiyong

I am running a model Y=beta0+beta1*X1+beta2*X2+beta3*X3+...+betan*Xn.
After running the model command, Stata automatically drops some
covariates because of colinearity. I want to get the final covariates
which are left in the model. What I did is something like this.
. reg y x1 x2 x3 x4 x5
. matrix beta = e(b)
. global covariates : colfullnames beta
Suppose x2 was dropped because of colinearity.
It gives me a global as
y:x1 y:x3 y:x4 y:x5 y:_cons
How can I remove "y:" in the global so that I have a global as "x1 x3 x4
x5 _cons"?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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