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: Data Management
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Data Management
Date
Wed, 28 Mar 2012 18:21:06 +0100
The different prefixes are not a problem. You want them to end up as
separate variables.
The -help- for -reshape- makes this explicit with examples like
reshape long inc ue, i(id) j(year)
In your case it will presumably be something like
reshape long cash securities <and so on>
Nick
On Wed, Mar 28, 2012 at 5:37 PM, David Ashcraft
<[email protected]> wrote:
> These all are balance sheet and income statement items e.g. cash, securities, inventory fixed assets sales etc.
Joerg Luedicke <[email protected]>
> "In my case v1 v2 v3 have completely different names."
>
> What does that mean? In what way exactly do they differ? What you
> posted does not indicate any differences between variable names across
> years or years across variable names.
>
> J.
>
> On Wed, Mar 28, 2012 at 9:10 AM, David Ashcraft
> <[email protected]> wrote:
>> I have my data in the following format
>>
>> id v1_97 v1_98 v1_99 ...... v1_11 v2_97 v2_98
>>
>> Each variable span over 15 years and there are total of 200 variables and about 4000 subjects (id). I want to change the dataset in a panel where data can be arranged like this:
>>
>> id year v1 v2 v3
>> 1 1997
>> 2 1998
>> 3 1999
>>
>> I thought this may be the case of RESHAPE - wide to long. In my case v1 v2 v3 have completely different names. Somehow I could not figure out, how to deal with this scenario. Any help will be really appreciated.
>>
*
* 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/