Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Reshape Data


From   "Susan Flaherty" <[email protected]>
To   <[email protected]>
Subject   st: Reshape Data
Date   Tue, 15 Feb 2005 13:31:15 -0500

Dear All,
I have an unusual dataset that I am trying to reshape, and the ususal
commands don't seem to apply.
An example of the data is as follows:

Code	890216(VO)		     691693(VO)
5/15/1995	0	                                       .
5/16/1995	0			      0.1
5/17/1995	0		                      0.2
5/22/1995	.		                      0.2
5/23/1995	0		                      0.2

I would like to obtain a standard panel (long format) so that I can run
some regressions:

FIRM	DATE	     TURNOVER
890216	5/15/1995	0	                                       
	5/16/1995	0			      
	5/17/1995	0		                      
	5/22/1995	.		                      
	5/23/1995	0		                     
691693	5/15/1995	.
	5/16/1995	0.1
	5/17/1995	0.2
	5/22/1995	0.2
	5/23/1995	0.2
	

The only unique identifier is the firm number (890216(VO)), and the
stem of the common text is the suffix rather than the prefix (e.g.
inc_90 inc_91 inc_92). 

I am currently trying something like:
.  reshape datafile 890216, i(code) j(turnover) string

But since the prefix is a unique number, I can't  replace the unique
number thousands of times.
I would greatly appreciate any suggestions on how to reformat the
data.

Thank you and regards,
Susan Flaherty
 
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index