The SAS Output Delivery System and reporting techniques

proc tabulate ods excel, un-merge cells

Reply
New Contributor
Posts: 2

proc tabulate ods excel, un-merge cells

in proc tabulate, if the case is simply like this

---------------------------------------------------

TABLE Gender*Blood,

              City*n;

---------------------------------------------------

Then I will get a table like following:

GenderBloodChicago

LA

MA14
B23
FA32
B41

Where you can see the gender column cells are merged within each level and with only one input. How can I have the cell unmerged and with the levels repeated in each row. like following. I know proc report probably can do this similar thing. but my tables are really complicated with all kinds of statistics and i wanna stick with proc tabulate. let me know if anyone have some good idea.

GenderBloodChicago

LA

MA14
MB23
FA32
FB41
Grand Advisor
Posts: 10,210

Re: proc tabulate ods excel, un-merge cells

What do you want?

New Contributor
Posts: 2

Re: proc tabulate ods excel, un-merge cells

clearly as the second table shows, in want the first row class (gender) with levels unmerged.

Grand Advisor
Posts: 10,210

Re: proc tabulate ods excel, un-merge cells

When I first looked at your post the tables didn't show.

Depending on the statistics and other complexity of the tables I have often preprocessed the data using summary or even tabultate to get the statistics ant then used tabulate or sometimes proc print to display similar results.

SAS Super FREQ
Posts: 8,719

Re: proc tabulate ods excel, un-merge cells

Hi:

  The way that TABULATE works with using the asterisk (*) operator, whether there are 19 levels of blood or 2 levels of blood within GENDER, then the rows for GENDER will span the rows for BLOOD.

TABLE Gender*Blood,    City*n;

 

There is no way in TABULATE to repeat nested or crossed values on every row (such as for GENDER), because, by default, TABULATE wants to make you a "nice" table with the "spanning" behavior. PROC REPORT would do what you want. But you said that you need TABULATE for "all kinds of statistics". REPORT has all the same statistics except the keywords for percentages and the KURTOSIS and SKEWNESS. And, because REPORT has the COMPUTE block, you could still calculate row percents or col percents if you needed to. Kurtosis and skewness are probably the only deal breakers, then.

cynthia

pix of REPORT output with LOTS of statistics and repeated values

Attachment
Ask a Question
Discussion stats
  • 4 replies
  • 669 views
  • 0 likes
  • 3 in conversation