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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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