Mental Health from Checkouts Over Time
MAT 259, 2024
Jing Peng

Concept
According to an article from the University of Michigan, “The annual Healthy Minds Study report is based on web surveys taken by 96,000 US students across 133 campuses in the 2021-22 academic year. It found that 44% of students reported symptoms of depression, 37% reported anxiety disorders, and 15% reported having seriously considered suicide in the past year—the highest recorded rates in the history of the 15-year-old survey."

With the checkout data from the Seattle Public Library, I’m trying to figure out the trend in books and other publications about anxiety in recent years, which can be seen as a projection of the trend in mental health changes in modern society, to some extent.

One of the perspectives is to collect data about how many publications have been released in recent years whose titles are more related to "anxiety," "stress," "panic," "depression," and “mental health.”. However, I could not get publications trending over these years and months with the current database.
Another one is to find out how many books and other things were checked out to show the increasing recognition of anxiety as a significant issue in people's lives. Then I realized that the rapid development of media would leading to a decline in traditional library visits.
So I get all the checkout numbers, regardless of their theme and other things. Then calculate the percentage of data related to mental health in these checkout records, which which reveal patterns and trends hidden within the data.

Query
SELECT 
YEAR(cout) AS years,
    MONTH(cout) AS months,
    COUNT(cout) AS counts
FROM
    spl_2016.outraw
WHERE
    (LOWER(title) LIKE '%anxiety%')
        OR (LOWER(title) LIKE '%stress%')
        OR (LOWER(title) LIKE '%panic%')
        OR (LOWER(title) LIKE '%depression%')
        OR (LOWER(title) LIKE '%mental health%')
GROUP BY years , months
ORDER BY years , months ASC;

SELECT 
    YEAR(cout) AS years,
    MONTH(cout) AS months,
    COUNT(cout) AS counts
FROM
    spl_2016.outraw
GROUP BY years , months
ORDER BY years , months ASC;

SELECT 
    YEAR(cout) AS years,
    MONTH(cout) AS months,
    SUM(CASE
        WHEN LOWER(title) LIKE '%anxiety%' THEN 1
        ELSE 0
    END) AS Anxiety,
    SUM(CASE
        WHEN LOWER(title) LIKE '%stress% THEN 1
        ELSE 0
    END) AS Stress,
    SUM(CASE
        WHEN LOWER(title) LIKE '%panic%' THEN 1
        ELSE 0
    END) AS Panic,
    SUM(CASE
        WHEN LOWER(title) LIKE '%depression%' THEN 1
        ELSE 0
    END) AS Depression,
    SUM(CASE
        WHEN LOWER(title) LIKE '%mental health%' THEN 1
        ELSE 0
    END) AS Mental_Health
FROM
    spl_2016.outraw
GROUP BY years , months
ORDER BY years , months ASC;
        

Process
Using MySQL, I have gathered checkout records from 2006 to 2023 and specifically identified those related to "mental health." I organized the data by month and calculated the percentage of checkouts that fall under the "mental health" category. This provides insights into the proportion of "mental health" checkouts concerning the overall checkout activity over these years.




Final result


This chart illustrates the relationship between the number of checkout publications related to anxiety and the total number of publications over time. Before 2018, the trend was basically the same. As the total number of publications rose, anxiety-related publications also rose. After 2018, with the downward trend of the total number, surprisingly, the number of anxiety-related publications still rose.

This chart depicts the percentage of checkout publications related to mental health out of the total number of checkout publications over time. Despite several unusually high points, we can see that, after 2018 or so, there is a higher percentage of checkout books related to mental health.

I selected the data before 2015 to get this chart. There is a lowest point in 2007-02 and a highest point in 2009.03. The global financial crisis, often referred to as the Great Recession, started in the latter part of 2007 and continued into 2008, which could be one of the reasons why this percentage increased gradually.

Then I selected the data after 2015 to get this chart. There is no date for the checkout record related to mental health topics in 2018-01 and 2018-02, which gives us two breakpoints. Also, due to COVID, the Seattle Public Library has been closed since March 13, 2020. Things went back to normal after July 2020. And it still demonstrates that the percentage of anxiety-related publications rose over time, especially from 2022-11 to 2023-07.

This graph shows how each of those words performs against each other. We can see that before 2018, the quantity of stress and depression was relatively high. However, in 2015 and 2020, there was a noticeable decline. On the other hand, for other categories, the quantity has been gradually increasing since 2018.


Code
All work is developed within Processing
Source Code + Data