Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar

summarize consistency

It would be nice if summarize when using a by had a consistent output.  Currently if you have 1 item it returns a list but when it's more than 1 it returns a list of lists.  I just check if the first item in it is a list and add it to a list but this seems silly.  

 

Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
summarize(dt, d1 = By(:age));
summarize(dt, d2 = By(:age, :sex));

show(d1, d2);

// d1 = {"12", "13", "14", "15", "16", "17"};
// d2 = {{"12", "12", "13", "13", "14", "14", "15", "15", "16", "16", "17", "17"}, {"F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M"}};

 

Tracking Number:

Defect ID: