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

st: tsset in panel data

From   Kit Baum <>
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)).


* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index