Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Problem declaring a panel dataset
From 
 
Milena Przheska <[email protected]> 
To 
 
[email protected] 
Subject 
 
st: Problem declaring a panel dataset 
Date 
 
Fri, 30 Aug 2013 13:18:26 +0200 
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/