My data looks like this, all columns with binary presence/absence data:
POP1 POP2 POP3 T1 T2 T3 T4 T5 T6 T7 T8 T9
1 1 0 1 1 1 1 0 1 0 0 1
1 0 1 0 1 1 0 1 1 0 1 1
1 1 0 1 1 1 1 0 0 1 0 1
0 0 0 0 1 1 0 1 0 1 1 0
1 0 1 0 0 1 1 1 0 1 1 0
0 1 0 0 1 1 1 0 0 0 0 1
0 1 0 1 1 0 1 0 0 0 0 0
1 1 1 0 1 0 0 0 1 0 0 0
0 0 0 0 1 1 1 1 1 0 0 1
1 0 0 1 0 1 0 1 0 1 1 1
1 1 0 0 1 0 1 0 0 1 0 0
1 0 1 0 1 1 1 0 1 0 1 0
0 1 0 1 1 1 1 0 0 0 0 0
1 0 0 0 1 1 0 0 0 0 1 1
The POP1:POP3 are populations, and I need counts of all 1's for all T1:T9 for all POP1=1, POP2=1 and POP3=1. I need a table that crosstabulates my data like this:
T1 T2 T3 T4 T5 T6 T7 T8 T9
POP1=1 3 9 7 5 3 4 4 5 5
POP2=1 4 7 8 6 2 3 2 0 3
POP3=1 0 3 4 2 2 2 1 3 1
Don't bother checking the aggregated counts, they're not necessarily correct. I've have tried lots of synthaxes without getting what I want. Thankful for some guidance.