I want to use proc tabulate to display the proportions/ total count of some variables conditioned on their values - if I only want to access one variable at once I was able to achieve this by setting a specific format (please check the MWE). However, if I want to access two variables at once (like score_1 >= x OR score_2 >=y) I get nowhere.
MWE:
data have;
input score_1 score_2;
datalines;
2 7
4 4
7 2
;
proc format;
value cut_fmt
low - 2 = 'non-critical'
3 - high = 'critical'
;
run;
proc tabulate data = have missing;
format score_1 score_2 cut_fmt.;
class score_1 score_2;
keylabel N = ' ' ColPCTN = '%' all = 'Total';
table score_1 * N score_2 * N, all;
run;
I now would like to have an extra row where it says:
score_1 OR score_2
non-critical 0
critical 3
Is there a way to achieve this in proc tabulate (this shouldn't be possible with a format statement I guess) or would I need to create a new variable before and just use this one then?
