change tne to cope with one subgroup with no observations