Calculate ratio