summarize function

Aggregate data using summary statistics