Bookmark and Share

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: issues with tsset based on more than a time variable and duplicates conflicting results


From   "Abdalla, Ahmed" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: issues with tsset based on more than a time variable and duplicates conflicting results
Date   Mon, 20 Jan 2014 17:10:54 +0000

Dear Statalist
I want to tsset my data based on  permno yr mth:
I tried - tsset permno yr mth  - I get the error message "too many varaibles specified"
I tried - gen firmid= group(permno)
              gen timeid = ym(yr, mth)
               tsset firmid timeid  - I get the error " repeated time values with panel
So I tried to investigate my duplicates :
I run the command:
duplicates report firmid timeid
I get
   copies | observations       surplus
----------+---------------------------
        1 |      2181223             0
        2 |        53712         26856
        3 |        16515         11010
        4 |         9556          7167
        5 |         5510          4408
        6 |         1698          1415
        7 |          196           168
        8 |           48            42
        9 |           18            16

I drop my duplicates and tsset my data, it works properly. But I though to investigate the duplicates again and run this code (of course before dropping my duplicates):
duplicates report permno mth yr, I get:

   copies | observations       surplus
----------+---------------------------
        1 |      2268476             0


Why both duplicates drop based on firmid and timeid versus permno yr mth are different though the firm id groups permno and the timeid groups yr and mth ?
Is there any other way to tsset my data based on permno yr mth rather than the grouping I have done (firmid and timeid) ?


Thanks

  
 
 
 
     
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index