Peer group formation in an adverse selection model