Authors write about misery and unhappiness around 10 years after they have experienced an economic downturn, a study has found.
Researchers compared words from more than five million books to decades of US and UK economy misery indices.
Data showed the frequency of words expressing sadness reflected the economic conditions in the 10 years prior to a book's composition.
There was a strong correlation over most of the 20th century between the 'literary misery index' and a moving average of the previous decade of the annual US economic misery index.
This increased when the researchers compared literary misery to an average of US and UK misery indices, the study found.
Literary misery was found to correlate best with a moving average of the previous decade of economic misery for the period 1929-2000.
Lead author of the study, Professor Alex Bentley of the University of Bristol, said: "When we looked at millions of books published in English every year and looked for a specific category of words denoting unhappiness, we found that those words in aggregate averaged the authors' economic experiences over the past decade.
"In other words, global economics is part of the shared emotional experience of the 20th century."
The researchers developed their literary index by examining how frequently 'mood words' were used through time in a database of more than five million digitalised books provided by Google.
Mood words were divided into six categories - anger, disgust, fear, joy, sadness and surprise.
A 'literary misery index' was then created, effectively comprising of the relative abundance of sadness words minus happiness words.
Researchers found that some periods, such as the 1980s, were clearly marked by literary misery, while others showed literary joy.
"It looked like Western economic history," said Professor Bentley, "but just shifted forward by a decade.
"Perhaps this 'decade effect' reflects the gap between childhood when strong memories are formed, and early adulthood, when authors may begin writing books.
"Consider for example, the dramatic increase of literary misery in the 1980s, which follows the 'stagflation' of the 1970s.
"Children from this generation who became authors would have begun writing in the 1980s."
The US economic misery index which was used in the study is the sum of inflation and unemployment rates.
Co-author of the study, Dr Alberto Acerbi, also from the University of Bristol, added: "Economic misery coincides with WW1 (1918), the aftermath of the Great Depression (1935) and the energy crisis (1975).
"But in each case, the literary response lags by about a decade, such that authors are averaging experiences over that decade."
The researchers also analysed books written in German to verify their results.
Co-author Paul Ormerod, an economist in London, said: "We were still very cautious about spurious correlations at this point but then we found virtually the same results for German economic vs. literary misery.
"The results suggest quite clearly that, contrary to post-modern literary theory, literature serves a purpose. It informs people about the human condition, and the content adapts to the conditions of the time."
Dr Vasileios Lampos, a post-doctoral computer scientist from UCL, said: "The best correlation window (10 to 11 years) is robust across our analysis. We confirmed it on various corpora, including books written in English and German, and with different tools for extracting emotional content from books."
'Books average previous decade of economic misery' is published in PLOS One.