calculate a ratio from a two- way frequency table