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

st: Insheeting from an irregularly-dated panel?


From   "Michael S. Hanson" <[email protected]>
To   [email protected]
Subject   st: Insheeting from an irregularly-dated panel?
Date   Fri, 13 Aug 2004 15:59:25 -0400

In a spreadsheet I have a balanced panel of irregularly-spaced (in time) quarterly observations on a single variable that I would like to import into Stata to impute (literally, -ipolate ..., epolate-) the missing quarterly observations.

The data span 40+ years across a moderate-sized (N=52) cross section. Each year has at least one quarterly observation -- usually Q3, sometimes Q2 -- and a few years have observations for both Q2 and Q3. Each row of the spreadsheet represents a cross-sectional unit (with a unique numerical code in column A and long string name in column B), and each column a quarter (with row 1 containing dates of the form "1955q3", etc.). I am saving the spreadsheet as CSV before using -insheet-.

After a long struggle I gave up trying to get Stata to recognize which quarters are missing and inserted all the remaining quarters with blank observations (with the quarter headings in row 1) into the spreadsheet. This kludge took the better part of an hour, so I'd appreciate any suggestions for a more automated and less labor-intensive approach -- as I have already had to do this procedure twice. TIA.

-- 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index