New function: calculate quartiles.