Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Dani Tilley <tilleydani@yahoo.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Re: tsset for panel time series |
Date | Thu, 1 Jul 2010 11:33:54 -0700 (PDT) |
Hi Martin and Nick, Thanks for your help. I was not including the panelvar in my tsset command. It's now OK. Best, DF Tilley ----- Original Message ---- <> I can see no problems in my example, Dani, so what is different in your code? *********** clear* 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 end expand 2, gen(id) list, noo sepby(id) gen mydate=monthly(string(month)+" "+ string(year), "MY") form mydate %tmMonth_CCYY tsset id mydate *********** HTH Martin From: Dani Tilley <tilleydani@yahoo.com> To: statalist@hsphsun2.harvard.edu Sent: Thu, July 1, 2010 1:55:10 PM Subject: tsset for panel time series Hi, 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. Thanks, Dani Tilley * * 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/