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: Rehape help
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Rehape help
Date
Mon, 6 Feb 2012 11:44:16 +0000
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/