Most of those affected were frail and elderly and at high risk of being very unwell, a study finds.