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

st: RE: Reshape Data


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Reshape Data
Date   Tue, 15 Feb 2005 18:48:34 -0000

Your -reshape- command is a long way 
from being legal, let alone appropriate. 

Please tell us about the names 
of the variables as you have them at 
present in Stata. No variable name in Stata 
can begin with a number. 

Nick 
[email protected] 

Susan Flaherty

> 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.

*
*   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