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

st: RE: -tsset- difficulties (was Re: dwstat v dwstat2)


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: -tsset- difficulties (was Re: dwstat v dwstat2)
Date   Sun, 6 Jun 2004 18:12:28 +0100

You've lost me here. I've looked through my 
posts of 2 June and I can't see any posting of 
mine on this topic. Also, I have no idea what 
-paneldate- is: -search- and -findit- 
yield nothing. 

There's perhaps some very simple underlying 
all this, or something rather odd, or both. 

As others are interested in similar issues, 
I'll underline a fundamental. 

If you have panel data, say 

. tsset id year 

and also therefore (usually) repeated times, 
Stata cannot make head or tail of 

. tsset year 

One reason enough for that is that 
with ties on year there is no 
unique sort order on -year- and 
no way to interpret time series 
operators such as L. without 
fatal ambiguity. 

There are circumstances in which 
one wants it both ways. In 
one problem Chris Wallace posed a while back 
on atmospheric pressures, pretending 
that separate days were separate 
panels meant that, as desired, 
various calculations were performed 
only within days. For other problems, 
treating the complete time series
as such would be essential. Here 
a panel is a device created 
for a purpose. 

My impression is that this is fairly 
rare, however. If you have panel 
data in the more standard sense, 
in which panels are distinct individuals, 
firms, areas, etc.,  
trying to get Stata commands to pool the 
data for separate panels and give you 
some kind of composite or aggregate model 
fit or test  will often be ill advised, 
impossible or both, as Kit Baum 
has argued trenchantly. 

This may well leave Clive's problem 
untouched, but I can't discern from 
below either what he wants or 
anything about his dataset which 
would be problematic. I don't believe
that changing the display format could 
or would have any effect over 
and above a previous -tsset-. 

Nick 
[email protected] 

Clive Nicholas 
 
> I'd like to echo the posts of others of my own difficulty in 
> being able to 
> -tsset- my year variable in my own datasets.
> 
> I've tried everything possible, including:
> 
> * Nick Cox's -paneldate- suggestion in a post in 2/6 (which 
> I'm unfortunately
>   not in position to recreate here, as it involves several 
> steps, but if I
>   recall generated the same year for each observation!); and
> * using -gen = _n- after -bysort- (which doesn't give me what 
> I want); and
> * using -gen, year()- or -yearly()-.
> 
> 
> After -format-ting my year variables into the %(4)ty storage 
> type, Stata still 
> refuses to -tsset- year: I still get the same "repeated time 
> values in sample" 
> r(451) error. Cracking this would be a major help. Thanks!

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