Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: Saving the "j" values in a local after reshape
From
Davide Cantoni <[email protected]>
To
[email protected]
Subject
Re: st: RE: Saving the "j" values in a local after reshape
Date
Thu, 1 Mar 2012 17:47:55 +0100
Thanks, Nick. I should have known that.
In fact, I just need levelsof, as I can use the local after the
-reshape- command. But thanks also for the suggestion on how to
recover such a list after having reshaped.
Davide
On 1 March 2012 17:39, Nick Cox <[email protected]> wrote:
> Before the -reshape-
>
> levelsof year, local(levels)
>
> (In the current Facebook-free-copy-of-Stata-to-be-given-away-extravaganza-votefest, a few people named -levelsof- as their favourite Stata command!)
>
> After the -reshape-
>
> unab years : year*
> local years : subinstr local years "year" "", all
>
> Nick
> [email protected]
>
> Davide Cantoni
>
> when using -reshape-, is there any way to save the levels of the "j" variable?
>
> To make my question clearer: a typical -reshape- command will return the output
>
> *** begin output
>
> . reshape wide inc, i(id) j(year)
> (note: j = 1980 1982 1983 1987)
>
> Data wide -> long
> -----------------------------------------------------------------------------
>
> *** end output
>
> So the question is: can this list of numbers (in the example above,
> "1980 1982 1983 1987") be saved as a local, for future use?
>
>
> *
> * 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/