Statalist The Stata Listserver


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

st: RE: Wide to Panel


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Wide to Panel
Date   Tue, 17 Oct 2006 14:12:02 +0100

You need to read in each file from Excel and -reshape- 
and then -save- it in Stata; and then -merge- the resulting
data files. 

If you number the files systematically, 
you can do it in a loop. An analogue is
the recent thread on -append-ing multiple
files. 

Whether you should export each file as comma-
or tab-separated or copy and paste into Stata
probably depends on details you haven't given
us, such as how much other gunk is in each
spreadsheet file. 

Nick 
n.j.cox@durham.ac.uk 

ALICE DOBSON
 
> I have a datafile containing an unabalanced panel of firms 
> for a period of
> around 10 years. This file contains data on around five 
> variables. I have
> procured additional data on around 15 firm-level variables 
> for these set of
> firms. However, the problem is that each variable is in a 
> different excel
> file and that too in a wide format. I can transfer these 
> files into stata
> format using stat transfer. Could anyone please tell me if 
> its possible to
> convert these multiple data files into one datafile in the 
> panel format?
> 
> Each individual file for a single variable looks like this. 
> There are 15
> such files, one for each varible. The numberf of firms is too 
> large and
> hence will take a lot of time to do by hand.
> 
> FIRM     1985    1986   1987   1988   1989   1990   1991   
> 1992   1993  1994
> 
> FIRM1   100      123      124     3001     293   324   512        413
> FIRM2
> FIRM3
> FIRM4
> :
> :
> :
> :
> FIRM1002

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