Model of social interaction and identity. (A) A focal individual (black) engages in beneficial economic interactions. (I) He first chooses a target for interaction (Table 1). In general, this decision may be based on both party and group identity. (II) The chosen target may then agree to engage or not, based on the identity of the focal individual. (III) If the pair interacts, the interaction is successful with probability if they share the same identity group, or if they belong to different identity groups. (IV) The benefit of a successful interaction is translated into a level of utility that depends on the underlying economic environment (denoted “wealth”) experienced by the focal individual. Depending on that environment, the agent’s utility function may be risk neutral (gray region), risk averse (red region), or risk tolerant (blue region), as described in Eq. 2. (B) The table shows default parameters for our analysis, although we vary these systematically in SI Appendix and show that our results are robust to parameter choice.