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 data from wide to long format
From
"Shittu, Aminu" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Reshape data from wide to long format
Date
Mon, 24 Sep 2012 05:34:52 -0700 (PDT)
Thanks Maarten and Nick!
A
________________________________
From: Nick Cox <[email protected]>
To: [email protected]
Sent: Monday, September 24, 2012 1:07:54 PM
Subject: Re: st: Reshape data from wide to long format
You don't show what you are trying, so that we can explain what you
are getting wrong.
At a guess, you need
reshape long month, i(species country year)
rename month incidence
rename _j month
What is crucial in such problems is (usually) seeing that the
identifier consists of several variables acting jointly.
See also
FAQ . . . . . . . . . . . . . . . . . . . . . . . . Problems with reshape
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
12/03 I am having problems with the reshape command. Can
you give further guidance?
http://www.stata.com/support/faqs/data/reshape3.html
On Mon, Sep 24, 2012 at 12:56 PM, Shittu, Aminu <[email protected]> wrote:
> I am trying some examples from online help but all in vain. My wide dataset looks like this one
>
> Species Country Year month1 month2 month3 month4 month5 month6 month7 month8 month9 month10 month11 month12
>
> I am interested in converting it to a long format like this
>
> Species Country Year month incidence
>
> Please note that the record for each month is a disease incidence.
*
* 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/
*
* 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/