BookmarkSubscribeRSS Feed
kota
Calcite | Level 5

Hello all,

 

I'm trying to create a summary table with kappa values.

I often use "proc tabulate" for making tables.

 

Is there a way to pull out the results of other procedures (like kappa statistics can be calculated by "proc freq"),

and make them appear in tables made by "proc tabulate"??

 

I'm not so used to "ods", however, will ods help me??

3 REPLIES 3
ballardw
Super User

My generic approach to using Proc Tabulate to display pre-calculated values is to make the variables VAR variable and request a statistic such as max or min with a suppressed label. The caution that needs to be used with this approach is that you need to make sure that your class variables always point to a unique value. If the base data has two values for one Class variable crossed with one then you lose (or summarize) the variable.

 

An example:

data example;
   input x y kappa;
datalines;
1 1 .9
1 2 1.3
2 1 1.8
2 2 .02
;
run;

proc tabulate data=example;
   class x y;
   var kappa;
   table x*kappa*(max=''),
         y
         /row=float
   ;
run;

The Row=float suppresses the empty cell that would hold the statistic label.

 

 

kota
Calcite | Level 5

I want to know if there is an approach to "pull out" the results of other procedures,

and like "paste it" in the proc tabulate output.

 

Is this some kind of a macro thing??

Or maybe using ods??

 

Anyway, thank you for your reply!

andreas_lds
Jade | Level 19

proc freq can write the results to a dataset, surely you have read that already in the documentation of proc freq. This dataset, can then be used as input for proc tabulate.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

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
  • 3 replies
  • 666 views
  • 0 likes
  • 3 in conversation