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

st: tsset in panel data


From   Kit Baum <kitbaum@mac.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: tsset in panel data
Date   Tue, 8 Jun 2004 09:43:02 +0100

Clive wrote that he had substantial difficulty getting the date variable right in tsset'ing a panel. The routine tsmktim of Baum and Wiggins (STB-57) was designed to ease that task in a pure timeseries environment (where it is often difficult to decode the date formats imported from, e.g., a spreadsheet, but you know what the first observation should be labelled).

With minor modifications, tsmktim can handle this task in a panel, where you specify an additional i(panelvar) option, similar to the way in which you would specify that variable for -iis-. The revised version of tsmktim is now available from SSC.

As a nonsensical example:

webuse auto
tsmktim counter,start(1970) i(rep78)

will create a panel from auto.dta in which the first observation of every group of 'rep78' is labelled 1970, the second 1971, etc. Like the original tsmktim, all date formats defined in Stata are supported (that is, one could say start(1970q2), start(1970m9), or even start(04jul1970)).

Kit

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