Can anyone tell me the proc report version of the following code?
proc tabulate data=abc;
class rule1 rule2 rule3;
var profit;
table rule1 rule2 rule3, profit*sum;
run;
Here rule1,rule2 and rule3 are binary variables with values 0,1. profit is continuous variable.
Thanks in advance..
Hi,
With TABULATE, you are "stacking" the table for RULE1 on top of the table for RULE2 on top of the table for RULE3. This is a unique capability of PROC TABULATE. It really doesn't matter that your "RULE" variables are binary variables or not. For example, look at this output from TABULATE where the variables shown in the row dimension are NOT binary variables. PROC TABULATE is stacking the table for COUNTRY on top of the table for PRODUCT, on top of the table for DIVISION.
There is no direct PROC REPORT ability such as TABULATE has to "stack" items in the row dimension of a table. You would have to restructure your data to even come close to what TABULATE is doing. For example, PROC REPORT would not be able to do this type of report, such as I shown in the screen shot, without restructuring the data in SASHELP.PRDSALE.
cynthia
Hi,
With TABULATE, you are "stacking" the table for RULE1 on top of the table for RULE2 on top of the table for RULE3. This is a unique capability of PROC TABULATE. It really doesn't matter that your "RULE" variables are binary variables or not. For example, look at this output from TABULATE where the variables shown in the row dimension are NOT binary variables. PROC TABULATE is stacking the table for COUNTRY on top of the table for PRODUCT, on top of the table for DIVISION.
There is no direct PROC REPORT ability such as TABULATE has to "stack" items in the row dimension of a table. You would have to restructure your data to even come close to what TABULATE is doing. For example, PROC REPORT would not be able to do this type of report, such as I shown in the screen shot, without restructuring the data in SASHELP.PRDSALE.
cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.