BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
xxformat_com
Barite | Level 11

Hi

When using ods output, a _TABLE_ variable is generated. However, I cannot figure out when the value is different from 1.

I was thinking that there could be a link with the TABLE variable but it does not seem the case.

Here is an example :

 

data abcd;
   a=1; b=1; c=1; d=1; output;
   a=2; b=1; c=0; d=4; output;
   a=2; b=1; c=0; d=4; output;
   a=1; b=1; c=1; d=1; output;
   a=1; b=1; c=1; d=1; output;

ods output CrossTabFreqs=demo;

proc freq data=abcd ; 
	table a*b a*c; 
run;

proc print data=demo noobs;
run;

_table_.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

ods output CrossTabFreqs=demo;

proc freq data=abcd ; 
	table a*b*c; 
run;

proc print data=demo noobs;
run;

View solution in original post

3 REPLIES 3
Reeza
Super User

ods output CrossTabFreqs=demo;

proc freq data=abcd ; 
	table a*b*c; 
run;

proc print data=demo noobs;
run;
ballardw
Super User

To go along with @Reeza example, look in the results window.

Notice that for a*b and a*c there is only one table each but for a*b*c there are multiple tables?

 

If you look in the results window you will see in each table something like "Table 1 of b by c" and "Controlling for a=1".

 

So each of the tables in the gets a number greater than one when there are more levels of the "controlling for"

 

Consider:

data abcd;
   input a b c d;
datalines;
1 1 1 1
2 1 0 4
2 2 0 4
1 1 1 1
1 1 1 1
3 2 1 1
3 2 0 0
3 1 1 4
3 2 1 4
;
ods output CrossTabFreqs=demo;

proc freq data=abcd ; 
	table a*b*c; 
run;

There are 3 levels of variable A now, so there are 3 "controling for" of table for the b*c

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1144 views
  • 2 likes
  • 3 in conversation