data pizza_likes; input ID $ A $ B $; datalines; 21 Yes No 22 No No 23 Yes Yes 24 No Yes 25 Yes Yes 26 Yes No 27 No Yes ; run;
proc freq data=pizza_likes; tables A*B / nocol nopercent norow; run;
proc sql; select sum(A='Yes') as Likes_A, sum(B='Yes') as Likes_B, sum(A='Yes' and B='No') as Likes_Only_A, sum(A='No' and B='Yes') as Likes_Only_B, sum(A='Yes' and B='Yes') as Likes_Both, sum(A='No' and B='No') as Likes_Neither, sum(A='Yes' or B='Yes') as Likes_Either from pizza_likes; quit;
... View more