Statalist The Stata Listserver


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

st: problem with a list returned by stata (r(varlist))


From   Val�rie Orozco <[email protected]>
To   [email protected]
Subject   st: problem with a list returned by stata (r(varlist))
Date   Fri, 23 Feb 2007 13:44:25 +0100

Hello,

What I want to do is to store lists (in a macro) of some variables in my data.
I use the command "ds" to have them and I thought that thanks to the return list r(varlist) I would be able to play with this in my program (make some differences and others manipulations of macrolists)...but ir doesn't work...

My example is the following :

ds Vol* /*I want Stata to show me all the variables beginning by "Vol" in my data*/
local liste1 `r(varlist)' /*I put it in a local list*/
di "`liste1'" /*to test it : it woks*/
local liste1bis `"`liste1'"' di `liste1bis' /*and it is a funny result*/

ds Vol*
VolBR4_seg0 VolBR1 VolBR5 VolBR9 VolMN3 VolMR5 VolS01MN1 VolS01MN5
Vol0BR4_seg0 VolBR2 VolBR6 VolMN1 VolMN5 VolMR3 VolS01MN2 VolS01BR4
VolBR4_seg1 VolBR3 VolBR7 VolMN2 VolMR1 VolMR4 VolS01MN3
Vol0BR4_seg1 VolBR4 VolBR8 VolMN4 VolMR2 Volmois VolS01MN4

. local liste1 `r(varlist)'

. di "`liste1'"
VolBR4_seg0 Vol0BR4_seg0 VolBR4_seg1 Vol0BR4_seg1 VolBR1 VolBR2 VolBR3 VolBR4 VolBR5 VolBR6 VolBR7 VolBR8 VolBR9 VolMN1
> VolMN2 VolMN4 VolMN3 VolMN5 VolMR1 VolMR2 VolMR5 VolMR3 VolMR4 Volmois VolS01MN1 VolS01MN2 VolS01MN3 VolS01MN4 VolS0
> 1MN5 VolS01BR4

. local liste1bis `"`liste1'"'

. di `liste1bis'
133008.88133008.8850295.1650295.1621709.86553108.0783532.6653183304.05706.5600625242.53178350.60974817.94556640.7429417 9.91461350.7854565.400414064.5413353.52565.5650.400002...262361.2294179.91461350.78514064.5414565.40043353.52183304.05

It seems that strings in a list returned by the "return list" command are coded...very stranged, isn't it?
If someone has an idea...

thank you very much for trying to help me


--

***********************
Val�rie Orozco
INRA ESR Toulouse
ESR INRA - BP52627 - 31326 Castanet Tolosan Cedex FRANCE
[email protected]
05-61-28-50-97
***********************




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