Can anyone help me to solve below problem? I want to count number of students that take all combinations of courses by gender. SAS Proc, data step or sql please. sample data that I have, in the sample there are only 4 courses, but there are more than 100 courses in my dataset. data student; input Student_ID$ Course$ Gender$; datalines; 1001 Math F 1001 Computer F 1001 Physics F 1002 Math M 1002 Physics M 1003 Math M 1003 Chemstry M 1003 Computer M 1003 Physics M 1004 Chemstry M 1004 Computer M 1004 Physics M ; Table that I want to get, combination is all the possible combinations of courses, Count_F is number of Female students take the combination of courses, Count_M is number of Male students take the combination of courses, Combination Count_F Count_M Math, Computer 1 1 Math, Physics 1 2 Math, Chemstry 0 1 Computer, Physics 1 2 Computer, Chemstry 0 2 Physics, Chemstry 0 2 Math, Computer, Physics 1 1 … … … Math, Computer, Physics, Chemstry 0 1
... View more