1. The summarize command stores its output in the variables that you supply. To get a data table you can either use the SUMMARY or TABULATE commands. The nice thing about summary and tabulate is that you can create exactly the sort of summary table that you need, and then just click the little red triangle and copy the resulting script. For example:
dt = Open( "$sample_data\Auto Raw Data.jmp" );
dt << Summary( Group( :AgeClass, :Gender, :Rating Class ));
2. To add more by groups just add them like so:
dt = Open( "$sample_data\Auto Raw Data.jmp" );
current data table(dt);
Summarize(a = by(:AgeClass, :Gender, :Rating Class), count_list = count());
The variables a and count_list now contain:
a
{{"Elder", "Elder", "Elder", "Elder", "Elder", "Elder", "Elder", "Elder", "Young",
"Young", "Young", "Young", "Young", "Young", "Young", "Young"}, {"F", "F", "F", "F",
"M", "M", "M", "M", "F", "F", "F", "F", "M", "M", "M", "M"}, {"A", "B", "C", "D",
"A", "B", "C", "D", "A", "B", "C", "D", "A", "B", "C", "D"}}
count_list
[2327, 3131, 1600, 353, 3469, 4509, 2392, 535, 228, 300, 122, 29, 288, 435, 228, 54]