Hell all,
I'm having difficulties with PROC FREQ and outputting the proc freq table into a separate output dataset. Some quick background on my situation: I created a model to predict an event and now I'm trying to evaluate how using different probabilities as cut-off points impact how well my model predicts if someone did or did not have the event of interest. So for example, maybe if I use a cut-off point of .10 (people with probabilities below .10 would be classified as NOT having the event and those with probabilties greater than or equal to .10 would be classified as having the event) my model would correctly result with X correct, Y false positive, Z false negative......
However, he is my problem, sometimes, in the proc freq table, one of the cells as 0 (maybe my cut-off point was too liberal and never resulted in false positives but resulted in a lot of false negatives). When I output the table into a new dataset, there are only 3 rows of data instead of 4.
IF that is still confusing, here is my code:
If you run this code and check the new output table, you will see that there are only 3 rows of data. SAS is simply omitting information from the 4th cell that contains 0 (test=negative, actual=positive). However, I want to have all 4 cells in the resulting output - even if a particular cell has 0 count.
Does anybody have any suggestions on how to make this happen?
I'm having difficulties with PROC FREQ and outputting the proc freq table into a separate output dataset. Some quick background on my situation: I created a model to predict an event and now I'm trying to evaluate how using different probabilities as cut-off points impact how well my model predicts if someone did or did not have the event of interest. So for example, maybe if I use a cut-off point of .10 (people with probabilities below .10 would be classified as NOT having the event and those with probabilties greater than or equal to .10 would be classified as having the event) my model would correctly result with X correct, Y false positive, Z false negative......
However, he is my problem, sometimes, in the proc freq table, one of the cells as 0 (maybe my cut-off point was too liberal and never resulted in false positives but resulted in a lot of false negatives). When I output the table into a new dataset, there are only 3 rows of data instead of 4.
IF that is still confusing, here is my code:
Code:
proc format;
value result 1='Positive' 0='Negative';
run; quit;
data test;
input test actual count;
format test actual result.;
cards;
1 1 39
1 0 788
0 1 0
0 0 500
;
run;
proc freq data=test order=data;
tables test*actual / nocol nocum norow nopercent outpct out=output;
weight count;
run; quit;Does anybody have any suggestions on how to make this happen?