Group living and investment in immune defence: an interspecific analysis