Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: tsset for panel time series

From   "Martin Weiss" <>
To   <>
Subject   st: RE: tsset for panel time series
Date   Thu, 1 Jul 2010 20:06:20 +0200


I can see no problems in my example, Dani, so what is different in your


input byte month int year byte(x y) 
2 2010 2 3
4 2010 5 6
3 2010 3 9
2 2009 2 2
1 2009 3 9

expand 2, gen(id)
list, noo sepby(id)

gen mydate=monthly(string(month)+" "+ string(year), "MY")
form mydate %tmMonth_CCYY
tsset id mydate


-----Original Message-----
[] On Behalf Of Dani Tilley
Sent: Donnerstag, 1. Juli 2010 19:55
Subject: st: tsset for panel time series


I'm trying to declare a panel time series and I'd appreciate some help. I
have data on several variables over time, as well as Year and Month
variables. I used -tostring- to convert Year and Month to string, and I
concatenated them into a third string variable (format YearMo). I then tried
to convert this third variable into date format using monthly(thirdvar,"ym")
and used it in tsset thirdvar and got an error message "repeated time values
in sample". I know I'm doing something wrong, but I can't figure out what or
how to fix it.'

Any help would be appreciated.


Dani Tilley

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index