Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How can I put the numerical values of a variable into a numlist?


From   Michael Norman Mitchell <Michael.Norman.Mitchell@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How can I put the numerical values of a variable into a numlist?
Date   Mon, 10 May 2010 23:47:08 -0700

Dear Antonis

  Does this example help?

. sysuse auto
(1978 Automobile Data)

. levelsof mpg
12 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 34 35 41

. local a = r(levels)

. di "`a'"
12 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 34 35 41

Best regards,

Michael N. Mitchell
See the Stata tidbit of the week at...
http://www.MichaelNormanMitchell.com

On 2010-05-10 10.43 PM, A Loumiotis wrote:
Dear Statalist,

Is there any way to put the numerical values of a variable into a
numlist beside doing it manually?

Thanks,
Antonis Loumiotis
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index