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

st: RE: covariate names


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: covariate names
Date   Tue, 2 Dec 2003 18:24:43 -0000

Your variable list is in global macro S_E_vl 
after -logistic-. Your response is in S_E_depv. 
So here is one way to do it; there may be 
better ones. Looking in e(b) is about as 
much work as this. 

After such a model, if you type 

. covars 

you will see a list and in addition 
the list will be in local macro -covars-. 

Here is -covars-

program covars 
	version 8.2
	capture local covars : subinstr global S_E_vl "$S_E_depv" "" 
	if _rc { 
		di as err "no covariates known?"
		exit 498
	} 	
	di as txt "`covars'" 
	c_local covars `covars' 
end 


Nick 
[email protected] 

Ricardo Ovaldia
 
> After an estimation command (logistic) are the
> covariate names saved in a macro? I know that I can
> get them from the -e(b)- matrix, but is there and
> easier way or code available?

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