hey @Cynthia_sas can you give a hand here please?
i have 4 variables (2 numeric and 2 categorical), two for column and row group like the exemple bellow (fx_cr and gh_simp). You can ignore the "x2" rows/columns.
and other two variable to make the sum(var 1)/sum(var 2) inside of each spot of the exemple above. Do you have a code for this? i tried but i couldnt do that.
Hi:
Without code and data, it's hard to provide any constructive suggestions. Your current output looks like PROC TABULATE output. What PROC REPORT code have you tried? It's not clear to me from your screen shot, which 2 variables need to be divided and whether the division results go in the row (at the bottom of the report) or in a column (to the right side of the report). Can you provide any sample data in the form of a DATA step program? To accomplish crosstabs with PROC REPORT, you have to define ACROSS variable(s). Here's a simple example using SASHELP.CLASS. Getting the sum of the HEIGHT variable is a bit silly, but is shows how to ask for the SUM statistic with a numeric variable under the ACROSS item and also shows the use of the absolute column number in the division:
Without data, it's hard to do more than provide you with this simple example.
Cynthia
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.