Immune function, height and resource accumulation comprise important life history traits in humans. Resource availability models arising from life history theory suggest that socioeconomic conditions influence immune function, growth and health status. In this study, we tested whether there are associations between family income during ontogeny, adult height, cortisol level and immune response in women. A hepatitis B vaccine was administered to 66 young Latvian women from different socioeconomic backgrounds, and blood samples were then collected to measure the level of antibodies that the women produced in response to the vaccination. Cortisol levels were measured from plasma samples pre- and post-vaccination. Women from wealthier families had lower cortisol levels, and women from the highest family income group had the highest levels of antibody titers against hepatitis B vaccine. No significant relationships were observed between cortisol level and immune function, nor between family income and height. The results show that income level during ontogeny is associated with the strength of immune response and with psychoneuroendocrine pathways underlying stress perception in early adulthood. The findings indicate that the quality of the developmental niche is associated with the condition-dependent expression of immune function and stress response.