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

st: RE: tsset


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: tsset
Date   Thu, 27 Jun 2002 18:45:07 +0100

Rita Luk

> I observed after I tsset PANEL TIME in my data, I can xtdes
> without setting
> iis tis.  Is this true for all xt commands?  Is there any difference in
> using tsset instead of iis tis in xt commands ?

On 19 April Vince Wiggins of Stata Corp posted this:

Stephen Jenkins <[email protected]> asks how -tsset- relates to -iis- and
-tis-,

> My experiments suggest that
> 	-tsset panelvar timevar-
> seems very similar to
> 	iis panelvar
> 	tis timevar
>
> [Try -tsset panelvar timevar-, as above, then -iis- and -tis-.]
> I discovered this having -tsset- my data and then run -xtlogit-
> successfully, without having first done a -iis- or -tis- or used the
> equivalent options in -xtlogit- .]
>
> To what extent are they really similar?
> E.g. I note from the Manual that -tsset- leaves behind r(timevar) and
> r(panvar) whereas  -iis- and -tis- set characteristics _dta[iis] and
> _dta[tis].  Any reason for this difference that is useful to know about?

Stephen is right, there is quite a bit of overlap between -tsset- and the
pair
of commands -iis- and -tis-.

-tsset- was introduced in Stata 6 along with time-series operators, and it
provides several new features in addition to subsuming most of the the role
of
the -iis/tis- commands.  Those new features include enabling time-series
operators, checking the data to be sure that it does not contain duplicate
time periods, and setting the periodicity of the data, e.g. quarter, yearly,
etc.  In general, -tsset- is always preferred to -tis- and often to -iis-,
see
below.

The -iis- and -tis- command have been in Stata much longer.  -iis- has
always
been the workhorse because all of the -xt- commands must know the variable
that stores the panel/group identifier.  Its sibling, -tis-, was introduced
to
provide a similar mechanism for the few -xt- commands that also needed a
variable identifying time, these commands include -xtgls- and -xtgee-.

Stephen notes that -iis- and -tis- set the characteristics _dta[iis] and
_dta[tis].  In truth, that is about all they do, it is the -xt- commands
that
then use this information.  -tsset- also sets these characteristics and sets
some additional characteristics used internally by the time-series
operators.
The commands also clear each others settings.  So, typing -iis id- will
clear
any existing -tsset- settings, and the reverse is also true.

All of the -xt- commands that recognize the -iis- and -tis- settings, or
that
take the i() and t() options, respect the settings of -tsset-.  When you
have
data with both group/panel and time identifiers, -tsset- is preferred
because
it enables time-series operators.  The relationship between -tsset- and
-iis/tis- should be clearer in the documentation.

I still use -iis-, or the i() option, because many of the -xt- commands
require only a panel/group variable; they do not need a time variable, for
example -xtlogit-.  (-tsset- requires a time variable and optionally allows
a
panel/group variable).  On the other hand, I almost never use tis except in
contracted form, " `tis the rare day that I use -tis-."

Nick
[email protected]

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