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]

st: RE: Re: Making panel format


From   "Md. Alauddin Majumder" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Re: Making panel format
Date   Thu, 11 Apr 2013 02:55:59 +0000

Dear Joseph Coveney,

Thank you so much for the help! I will try it.

Regards
Majumder


________________________________________
From: [email protected] [[email protected]] on behalf of Joseph Coveney [[email protected]]
Sent: Wednesday, April 10, 2013 9:36 PM
To: [email protected]
Subject: st: Re: Making panel format

Md. Alauddin Majumder wrote:

I want to reshape the following data to make it panel:

ID status_1997january status_1997february . . . status_2010december

[snip]

Is there any way to do this? Any help will be greatly appreciated.

--------------------------------------------------------------------------------

You could try something like the following.

    reshape long status, i(ID) j(discard) string
    generate int yearmonth = monthly(substr(discard, 2, .), "YM")
    format yearmonth %tm
    drop discard

Joseph Coveney

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index