Maoyong Fan wrote:
Dear Friends,
First of all, I run a OLS regression. The reg command automatically drop some
variables which cause multicolinearity.
Secondly, I want to use the covariates which OLS just used to run other
regressions.
I know e(depvar) gives the name of dependent variable. But I can not find some
command in Stata to give me the name list of dependent variables (not include
the dropped variables). Could you give me some hint?
--------------------------------------------------------------------------------
Names of the independent variables that were used in the regression (including
the constant if you included in the model) are assigned as names of the columns
of the e(b) and e(V) matrices. You can see them with -matrix list e(b)- or
-matrix e(V)-.
For use later, you can easily get these column names into either a local or
global macro via an extended macro function. -help matmacfunc- will show you
see how this is done--it's the last example in the list of examples at the end
of the help file. Once in the macro, you can use -tokenize- or -gettoken- to
get individual names.
Joseph Coveney
*
* 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/