Dear all, I'm working with 2 tables : one contains all possible combinations of 2 factors among 4: comp_1 comp_2 A B A C A D B C B D C D and the other contains the statistical units : fact_A fact_B fact_C fact_D unit1 0 0 1 1 unit2 1 0 1 1 unit3 0 1 0 1 unit4 1 0 1 0 unit5 0 1 1 1 unit6 1 1 0 0 (unit1 has C and D factors ; unit 5 has B, C and D factors) I would like to know how many units there are for each combination (mod_1,mod_2). In this example, the result would be : comp_1 comp_2 nb_units A B 1 A C 2 A D 1 B C 1 B D 2 C D 3 I can find easily this result with a loop but my problem is that, actually, there are much more than 4 factors. And thus, the treatment is too long with a loop. So, I would like to know if my counting could be done with matrix calculation, especially with SAS IML ? Hoping that my request is clear... In advance thank you to all those who will try to help me. Céline
... View more