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

st: insheet/replace with panel data: best practices?


From   "Michael S. Hanson" <mshanson@mac.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: insheet/replace with panel data: best practices?
Date   Tue, 17 Aug 2004 14:28:06 -0400

	I have several spreadsheets that contain panel data in a "wide" format
on a single variable: dates across the top, cross-sectional identifiers
down the left.  I have been reading them into Stata with -insheet- (as
CSV) and then using -reshape-, but find that this approach is
sub-optimal in that I often loose the dates -- they are recast as v2,
v3,  etc.  I can write code to re-create the dates, but this practice
is neither transparent nor general.  (Transposing the data hasn't
helped:  then I loose the cross-section identifiers.)

	I'm curious how other people approach this issue.  Perhaps there is a
better way to organize the data in the spreadsheet, or perhaps I should
use a different Stata command.  I've looked briefly at -infix- and
-infile-, but they don't seem to address this particular issue.  (The
data are balanced and comma-separated.)  But then again, I may be
missing something.

	My ultimate goal (conceit?) is something sufficiently transparent (a
few lines of code?) that I can give to undergrads with limited Stata
experience and have them pull off a data import of this type without
any problems -- or intervention by me.  This seems like it should be
much simplier than I have made it so far.  Thanks in advance for any
suggestions.

                                         -- Mike

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