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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: identify unique string values within lists of elements over chosen time windows


From   Denisa Mindruta <mdenisa@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: identify unique string values within lists of elements over chosen time windows
Date   Thu, 21 Mar 2013 16:22:54 -0700 (PDT)

Hi everyone. I have an unbalanced, large panel dataset, where each observation 
can take multiple string values (each string is stored in a separate variable). 
At each point in time, I need to count whether the string value(s) taken by an 
observation are "new" , meaning that they do not show up among the values taken 
by the same observation in previous years. How should I approach  this problem ? 
Thanks !  Below is a description of data. I need to calculate newval

obs     yr   var1    var2    var3    newval
1        90   str1    str2    str3     3
1        91    str1    str4    str5     2
2        90    str3    str4              2
2        91    str4    str5              1
2        93    str3    str5              0
2        94    str7                       1  

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index