Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Cohen, Elan" <cohened@upmc.edu> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: Reshape question |

Date |
Fri, 29 Mar 2013 18:25:00 +0000 |

How about this: foreach var of varlist var2-var4 { rename `var' VoI`=`var'[1]' } drop in 1 rename var1 date g id = _n reshape long VoI, i(id) j(firmid) drop id HTH, - Elan -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of thomas bourveau Sent: Friday, March 29, 2013 14:10 To: statalist@hsphsun2.harvard.edu Subject: st: Reshape question Dear Statlist readers, I now have an issue trying to reshape my dataset. Currently, a simplified version of my dataset looks as follows : var1 var2 var3 var4 Code 111111 111112 111113 01/01/2000 10 11 22 01/02/2000 20 14 25 .. .. 01/12/2008 23 17 28 Specifically, my columns name are var1, var2, var3.... In the first line of the dataset, except for the first column, there is the firms identifier. As you can see from my example, the next lines provide the value of my variable of interest for all the firms in the sample at a given point in time. I need to work with a dataset that would be organized as follows : Firm ID Date Variable of Interest 111111 01/01/2000 10 .. .. 111111 01/12/2008 23 111112 01/01/2000 11 .. .. 111112 01/12/2008 17 111113 01/01/2000 22 .. .. 111113 01/12/2008 28 I have been through several stata tutorials online. However, I do not think that my case fit with the basic wide / long reshape examples that I've found. I would appreciate any suggestion to find a solution. Best, Thomas -- Thomas Bourveau thomas.bourveau@gmail.com 0637573925 * * 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/

**Follow-Ups**:**Re: st: RE: Reshape question***From:*thomas bourveau <thomas.bourveau@gmail.com>

**Re: st: RE: Reshape question***From:*thomas bourveau <thomas.bourveau@gmail.com>

**References**:**st: Reshape question***From:*thomas bourveau <thomas.bourveau@gmail.com>

- Prev by Date:
**st: Reshape question** - Next by Date:
**st: lrtest/aic/bic for discrete choice model with gllamm** - Previous by thread:
**st: Reshape question** - Next by thread:
**Re: st: RE: Reshape question** - Index(es):