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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Combinations of variables


From   Richard Goldstein <richgold@ix.netcom.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Combinations of variables
Date   Tue, 04 Jun 2013 10:21:54 -0400

if I understand you correctly, I would use -egen- with the "concat"
option and then just tabulate the new variable (possibly using the sort
option as in -ta newvar, sort-

Rich

On 6/4/13 10:14 AM, Seliger Florian wrote:
> Dear Statalist,
> 
> I need to find the most frequent combinations of variables in my dataset.
> There are 12 variables of interest each coded 0/1.
> 
> Example:
> 
> ID           var1       var2       var3 ..
> 1             0             1             0
> 2             0             0             1
> 3             0             1             0
> 4             1             1             1
> 5             0             1             0
> .
> .
> .
> 
> In this example, the most frequent combination is var1=0, var2=1, var3=0 (for ID 1, 3, 5).
> 
> At the moment, I have no idea how to find out the combinations for so many different cases automatically.
> 
> 
> Thanks for your consideration.
> 
> Florian
*
*   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