A generalisation of the number to treat statistic