Generalise response rates table code