Calculate average prices for each group