Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Roberto Liebscher <roberto.liebscher@ku.de> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Problem declaring a panel dataset |
Date | Fri, 30 Aug 2013 13:28:44 +0200 |
Have you tried to use the clocktime option when typing your xtset command? xtset panelvar timevar, clocktimeAnother opportunity to check for duplicates is to use the duplicates command which may show duplicates your command does not bring up:
duplicates list panelvar timevar Hope this helps, Roberto Am 30.08.2013 13:18, schrieb Milena Przheska:
Dear Statalist members, I am getting the following error when declaring a panel dataset: "repeated time values within panel" I have checked for duplicate records using the following command: bys code when: gen dup = cond(_N==1,0,_n) I get this description of duplicates with -tab- dup | Freq. Percent Cum. ------------+----------------------------------- 0 | 164,787 91.61 91.61 1 | 7,241 4.03 95.63 2 | 7,241 4.03 99.66 3 | 499 0.28 99.93 4 | 71 0.04 99.97 5 | 18 0.01 99.98 6 | 14 0.01 99.99 7 | 8 0.00 100.00 8 | 8 0.00 100.00 ------------+----------------------------------- Total | 179,887 100.00 But when I listed duplicates, this is what I could see: list if dup>1 when code dup 28apr2013 08:20:55 a 2 28apr2013 08:21:06 a 2 04may2013 10:44:43 a 2 04may2013 10:45:28 a 2 The variable "when' is in %tc format, and I use the same format when declaring a panel dataset. Yet, Stata seems to only look at the date, not the hour, minute and seconds part of the variable. Can anyone please tell me what can I do to correct this situation? I appreciate your help and I thank you in advance. Best, Milena Przheska * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/
* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/