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: reshape


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: reshape
Date   Wed, 26 Oct 2011 12:31:44 +0100

Just -rename- the awkward variables first. It's usually far easier.
The new -rename- in Stata 12 has lots of examples. If you are still on
Stata <12, download -renvars- (SJ).

Nick

On Wed, Oct 26, 2011 at 11:53 AM, Ozgur Ozdemir
<ozdemirozgur@hotmail.com> wrote:

 I would like to change of my data format using reshape. it seems, it
is a great function however my variable names are a bit problematic. I
have the following example
>
> CompanyId, Tobin2000, Tobin01, Tobin02, Sales2000YE, Sales2001YE etc. All variables are on yearly basis.
>
> Some variables have 01 for 2001, 02 for 2002 but some of them have exactly 2001, 2002 etc. Not sure, how I can use reshape command?
>
> my command below:
>
>
> "reshape long Tobin sales@YE, i(Companyid) j(year) string"  does not help because stata creates both 01 and 2001.
>

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