how to calculate frequency rate graphs