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

st: RE: tsset in panel data


From   "Taylor, Andrew" <Andrew.Taylor@erhha.nhs.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: tsset in panel data
Date   Tue, 8 Jun 2004 11:32:49 +0100

Hi

I had a similar difficulty with the tsset'ing of a panel dataset some
months ago.

In the end I created a new time variable,  unfortunately I can't quite
remember the syntax I used and it's on my old computer hard drive,  but
I remember that it was not entirely straightforward.

Then when I used tsset using the new time variable it was ok.

Hope this will help.

Andrew

..............................................................
Andrew J Taylor
Head of Public Health Science
East Yorkshire and Hull Primary Care Trusts
Health House
Willerby
HU10 6DT
01482 672066
andrew.taylor@erhha.nhs.uk
...............................................................


-----Original Message-----
From: Kit Baum [mailto:kitbaum@mac.com] 
Sent: 08 June 2004 09:43
To: statalist@hsphsun2.harvard.edu
Cc: Clive Nicholas
Subject: st: tsset in panel data

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/

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