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

Re: st: How to get covariate names after OLS regression

From   Joseph Coveney <>
To   Statalist <>
Subject   Re: st: How to get covariate names after OLS regression
Date   Mon, 28 Jun 2004 09:32:14 +0900

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 

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:

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