Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: tsset problem


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: tsset problem
Date   Thu, 3 Dec 2009 11:05:58 +0000

2009/12/3 "Elisabeth Müller" <[email protected]>:
> Hello,
>
> I have a problem when defining a panel. I type:
>
> tsset id year
>
> the error message is:
> repeated time values within panel
>
> Everything is ordere by id. What could be the problem?

At a guess (without seeing your data), probably exactly what Stata is
telling you!

You have some individuals (id) where there is more than one
observation for a given year.  For example...

input id year
1 2001
1 2002
1 2003
2 2001
2 2002
2 2002
2 2003
end

tsset id year
repeated time values within panel
r(451);

. drop in 6
(1 observation deleted)

. tsset id year
       panel variable:  id (strongly balanced)
        time variable:  year, 2001 to 2003
                delta:  1 unit


In the above example person 2 has two entries for the year 2002,
you'll have some similar error in your data.

Neil

-- 
"The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data." ~ John Tukey (1986), "Sunset salvo". The American
Statistician 40(1).

Email - [email protected]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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