Formula for mean of grouped data