Statalist


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

st: re: getting a list of included variables in estimation


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re: getting a list of included variables in estimation
Date   Tue, 31 Jul 2007 07:53:39 -0400

Sorry, _rmcoll returns r(varlist), not varlist. Here is the complete solution:

* mpg2, turn2 are copies of mpg and turn
reg price mpg mpg2 turn turn2
local regressors : colnames e(b)
local regressors: subinstr local regressors "_cons" " "
_rmcoll `regressors'
di "`r(varlist)'"
local vv `r(varlist)'

foreach v of local vv {
test `v'
}



Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
* 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