The demographic transition is when a population shifts from being one of high child mortality rates and high fertility rates to one that is low in both. Western nations completed this transition by the early 1900s. It occurred in two stages. Initially, child mortality rates dropped significantly due to improved healthcare and sanitation and better nutrition, yet fertility rates remained high, leading to a population boom. Gradually, fertility rates fell as people became more affluent and had better access to contraception. By 1900, the infant mortality rate in England was 10%, down from about half in the Middle Ages. There was no catastrophic epidemic or famine in England or Scotland in the nineteenth century—it was the first century in which a major epidemic did not occur throughout the whole country, and deaths per 1000 of population per year in England and Wales fell from 21.9 from 1848 to 1854 to 17 in 1901 (cf, for instance, 5.4 in 1971). Social class had a significant effect on mortality rates: the upper classes had a lower rate of premature death early in the nineteenth century than poorer classes did.