Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Reshaping data


From   "Pavlos C. Symeou" <p.symeou@jbs.cam.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Reshaping data
Date   Wed, 28 May 2008 17:01:05 +0100

Dear Statalisters,

I need some help in reshaping the following data. The data are panel
data pertaining to two firms "EAM" and "OLY" for 10 months. I have
collected data for these two firms and stored them under five 
variables
var1 - var5. The data were originally stored in the following form.

month 	var1_EAM 	var2_EAM 	var3_EAM 	var4_EAM 	var5_EAM 	var1_OLY
var2_OLY 	var3_OLY 	var4_OLY 	var5_OLY
1 	14199 	3192 	8 	6 	10 	64003 	13916 	0 	0 	0
2 	86973 	21593 	5 	3 	3 	70008 	12936 	0 	1 	0
3 	127464 	34696 	5 	9 	6 	69597 	16433 	4 	0 	0
4 	122307 	37153 	9 	4 	5 	59272 	10406 	9 	0 	0
5 	127587 	32872 	3 	4 	2 	51431 	11139 	1 	0 	0
6 	45630 	14429 	6 	4 	2 	10227 	3080 	0 	0 	0
7 	40668 	11433 	1 	3 	1 	7414 	2225 	0 	0 	0
8 	26829 	10196 	3 	5 	1 	6957 	3382 	0 	0 	0
9 	30642 	11101 	1 	2 	1 	4452 	6273 	0 	0 	0
10 	61746 	20068 	7 	3 	0 	18103 	15648 	0 	0 	0


I would like to reshape it as follows. Can you please suggest how?

month 	firm 	var1 	var2 	var3 	var4	var5
1 	EAM
2 	EAM
3 	EAM 		
4 	EAM 	
5 	EAM 	
6 	EAM 	
7 	EAM 	
8 	EAM 	
9 	EAM 	
10 	EAM 	
1 	OLY 	
2 	OLY 	
3 	OLY 	
4 	OLY 	
5 	OLY 	
6 	OLY 	
7 	OLY 	
8 	OLY 	
9 	OLY 	
10 	OLY 	



Regards,

Pavlos

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index