Anxiety was associated with stress and reduced sleep quality, and the combination of anxiety and stress reduced the positive effects of social capital on sleep quality.