Bookmark and Share

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: Reshape help


From   Tim Evans <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: Reshape help
Date   Mon, 6 Feb 2012 12:31:42 +0000

Nick, Phil,

Thanks for your replies, that's worked a trick. I had too much incorrect code to show, but I agree it would have been helpful.

Best wishes

Tim

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: 06 February 2012 11:44
To: [email protected]
Subject: Re: st: Rehape help

We can't say where you are going wrong if you don't show us any code,
but consider

reshape wide Var1, i(Lab) j(startyear)

Nick

On Mon, Feb 6, 2012 at 11:21 AM, Tim Evans <[email protected]> wrote:

> I'm using Stata 11.2 and want to use reshape to change the layout of my data and I'm struggling a bit. My current data look like this:
>
> Var1       startyear              Lab
> 0.6692   1986                       1 1
> 0.7734   1986                       2 1
> 0.5548   1986                       3 1
> 0.6590   1987                       1 1
> 0.7526   1987                       2 1
> 0.5972   1987                       3 1
>
> What I want to have is
>
> Lab         Var1Startyear1986           Var1Startyear1987
> 1 1          0.6692                                   0.6590
> 2 1          0.7734                                   0.7526
> 3 1          0.5548                                   0.5972
>
> I've tried reshape with a variety of different syntax, but cant seem to reproduce how I want the data.

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

_DISCLAIMER:
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index