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

st: SV: RE: Namelist...


From   "Alexander Severinsen" <alex@markedsfakta.as>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: SV: RE: Namelist...
Date   Tue, 18 Jun 2002 15:06:50 +0100

Thank you, that did the trick!

Regards, Alex

-----Opprinnelig melding-----
Fra: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] På vegne av Nick Cox
Sendt: 18. juni 2002 13:25
Til: statalist@hsphsun2.harvard.edu
Emne: st: RE: Namelist...


Alexander Severinsen
> 
> I would like to define variables in a namelist. I am used to Limdep 
> where this is easily done with: namelist; x = var1 var2 var 3 etc. 
> This makes it easy to later do analysis on the variables in the list 
> f. ex :
> 
> regress depvar x(varlist)
> 
> I tried to look for this in the manual for Stata but could not find 
> it. Does anyone know how to define this in Stata?
> 

Sounds like a case for using a local macro. 

local vars "var1 var2 var3" 
regress depvar `vars' 

See [U] 21.3.1. 

Nick 
n.j.cox@durham.ac.uk 
*
*   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/

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