@ChrisNZ wrote:
> I was thinking of something like this:
This does not answer the question.
You have a multidimensional crossing. How do you want to show it?
@mkeintz 's solution give you a summarised overview (WANT2 below).
You could also want a detailed overview (WANT1 below).
Or anything in between.
data T1 T2 T3 T4 T5;
do I=1 to 1000;
if ranuni(0)>.6 then output T1;
if ranuni(0)>.6 then output T2;
if ranuni(0)>.6 then output T3;
if ranuni(0)>.6 then output T4;
if ranuni(0)>.6 then output T5;
end;
run;
data WANT1;
merge T1(in=A) T2(in=B) T3(in=C) T4(in=D) T5(in=E);
by I;
src=catx('-',ifc(A,'T1',''),ifc(B,'T2',''),ifc(C,'T3',''),ifc(D,'T4',''),ifc(E,'T5',''));
run;
proc tabulate data=WANT1;
class SRC;
table src=' '*n=' ';
run;
data WANT2 (keep=ROW COL );
length ROW COL $4;
merge T1(in=A) T2(in=B) T3(in=C) T4(in=D) T5(in=E);
by I;
array _in {5} in1-in5;
do C=1 to 5;
COL=cats('SET',C);
if _in{C}=1 then do R=C to 5;
ROW=cats('SET',R);
if _in{r}=1 then output;
end;
end;
run;
proc tabulate data=WANT2 noseps;
class ROW COL;
table ROW=' ' , COL=' '*n=' ';
run;
SET1
SET2
SET3
SET4
SET5
SET1
405
.
.
.
.
SET2
163
389
.
.
.
SET3
162
151
397
.
.
SET4
151
156
161
396
.
SET5
158
160
167
178
396
T1
T1-T2
T1-T2-T3
T1-T2-T3-T4
T1-T2-T3-T4-T5
T1-T2-T3-T5
T1-T2-T4
T1-T2-T4-T5
T1-T2-T5
T1-T3
T1-T3-T4
T1-T3-T4-T5
T1-T3-T5
T1-T4
T1-T4-T5
T1-T5
T2
T2-T3
T2-T3-T4
T2-T3-T4-T5
T2-T3-T5
T2-T4
T2-T4-T5
T2-T5
T3
T3-T4
T3-T4-T5
T3-T5
T4
T4-T5
T5
57
35
24
8
13
18
29
13
23
45
19
20
15
30
19
37
61
25
23
20
20
24
26
27
54
32
26
35
53
41
43
Hi @ChrisNZ
I will try this tomorrow morning. To be honest, I do not understand some lines of the code. However, this is amazing and it's way better that I wanted.
I will deeply look into it to at least understand a small part of it 🙂
EDIT:
@ChrisNZ
Tried WANT1 and it works perfectly, thanks to you. However, for WANT2, it doesn't seem to works. It gives me an empty dataset with the two variables (ROW COL)...
... View more