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: non-mutually exclusive factors


From   "Benhoen2" <benhoen2@earthlink.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: non-mutually exclusive factors
Date   Fri, 8 Oct 2010 16:28:57 -0400

I have some factors that are not mutually exclusive and i want to bin my
data among the various permutations of the factors. 

For example say there are two factors A and B.  There are 4 possibilities:
none, A, B and AB.  For 3 factors A B & C there are 8 possible outcomes:
none, A, B, C, AB, AC, BC, and ABC.  As the number of factors grows the
number of permutations doubles, e.g., 5 factors have 64 permutations.  

Is there any clever .do file to bin cases between multiple factors?  Or
alternatively any advice on a loop file that both bins the cases, and uses
the factor name to create labels.  I have 5 factors I am interested in
binning between.

Thanks, as always,

Ben  

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index