Introduction A common task in data analysis and statistics is to calculate the sum or mean of a continuous variable. If that variable can be categorized into 2 or more classes, you may want to get the sum or mean for each class. This sounds like a simple task, yet I took a surprisingly long time […]