BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I've a complicated table to produce with several subgroups. I have got so far by experimenting with the data formats etc but have come to a blank and wondered if anyone could help me?

The table format is...

group subgroup
group1 subgroup1
subgroup2
subgroup3
all
group2 subgroup1
subgroup2
subgroup3
all
overall subgroup1
subgroup2
subgroup3
all

sorry about the spacing..

I can get it to this except the subgroup label comes out for all groups and subgroups and I only want it at the top. The code I have used for ods output is

proc tabulate data=all;
class group subgroup1 subgroup2 subgroup3;
classlev group subgroup1 subgroup2 subgroup3;
var id var1 var2 var3 var4 var5;
table (group='group' all=[label='Overall'])
*(subgroup1='' subgroup2='' subgroup3='' all=[label='all']),
(var1='var1' var2='var2' var3='var3' var4='var4' var5='var5')*(N=''*f=3.);
run;

I can see one way to do this is to amend the subgroups to one super subgroup will all as part of it but want to use the raw data if possible.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
I don't quite see what you mean by "subgroup label comes out for all groups and subgroups and I only want it at the top". When I use your code with some dummy data, I get the table shown below. Do you mean the word "group" or the word "all" or the word "Overall" in the table below. Or, do you want to make the top row header with "group" disappear entirely and place some information in the BOX area (above the row header area line)????

cynthia
[pre]
------------------------------------------------------------
| | var1 | var2 | var3 | var4 | var5 |
|-----------------------+------+------+------+------+------|
|group | | | | | | |
|-----------+-----------| | | | | |
|CANADA |EAST | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |WEST | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |FURNITURE | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |OFFICE | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |CHAIR | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |SOFA | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |all | 192| 192| 192| 192| 192|
|-----------+-----------+------+------+------+------+------|
|GERMANY |EAST | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |WEST | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |FURNITURE | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |OFFICE | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |CHAIR | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |SOFA | 96| 96| 96| 96| 96|
| |-----------+------+------+------+------+------|
| |all | 192| 192| 192| 192| 192|
|-----------+-----------+------+------+------+------+------|
|Overall |EAST | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |WEST | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |FURNITURE | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |OFFICE | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |CHAIR | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |SOFA | 192| 192| 192| 192| 192|
| |-----------+------+------+------+------+------|
| |all | 384| 384| 384| 384| 384|
------------------------------------------------------------

[/pre]

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 494 views
  • 0 likes
  • 2 in conversation