s-news
[Top] [All Lists]

Re: Wide to long format

To: GRAHAM LEASK <grahamleask@btopenworld.com>
Subject: Re: Wide to long format
From: Neil Hepburn <nhepburn@ualberta.ca>
Date: Sat, 22 Apr 2006 07:53:03 -0600
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <20060422131948.43593.qmail@web86204.mail.ukl.yahoo.com>
References: <20060422131948.43593.qmail@web86204.mail.ukl.yahoo.com>
There are a couple of ways.  If you want to work from the command line,
then stack will do it.  Use ?stack to find the details.

Alternatively, use the stack function under Data->Restructure if you
want to use the graphical interface.  

-Neil
On Sat, 2006-04-22 at 14:19 +0100, GRAHAM LEASK wrote:
>  
>  
> I have a file where "firms" is the column containing the row names and
> I have ten separate "year" columns each with the data for that year.
>  
> How can I most simply convert this "wide format" data into long format
> i.e. ten consecutive repetitions of the row names, aligned to one
> column of data and a second column - categorical variable -
> identifying the year which that data corresponds to.
>  
> Any help would be greatly appreciated
>  
> Kind regards
>  
>  
> Graham


<Prev in Thread] Current Thread [Next in Thread>