7  Causal Inference

7.1 The Factors

Of the many variables available to us, we will focus on a few of the ones in our locus of control to try to predict affect. We have:

  • Affect (1 to 5): As seen in Chapter ?sec-mood, affect is measured using the Daylio app on a scale of 1 to 5.

  • Previous Sleep (0 to 100): The quality of the previous night of sleep is quantified using Fitbit’s sleep score. See Chapter ?sec-sleep for more details.

  • Social (Present/Absent): Is considered present if there were significant social interactions during the day. Mingling with co-workers, friends, family would count towards this metric. Note that I do not consider days alone with my partner to be social.

  • Proper Attention (Present/Absent): Any form of mindfulness or reflective practice such as journaling, meditation, yoga, silent walk, extensive gratitude practices time spent in nature or spent paying attention to reality as it is.

  • Learn/Create (Present/Absent): Can be obtained by creating material for my students, writing blog articles, recording YouTube videos, reading books and articles, following an online course or listening to a podcast.

  • Movement (0 to infinity): Although I track various forms of movement as a binary outcome in Daylio, I think it’ll be more nuanced to use Fitbit’s activity calories since it’s a continuous measure. There are many metrics we could use instead. or example, we could look at the number of active minutes versus sedentary or the number of steps.

  • Healthy Food (Present/Absent): A day consisting of home cooked meals and a few snacks in moderation is considered a healthy food day. Ideally, we could have an objective metric on a spectrum for diet but a subjective evaluation will have to do for now.

  • Mostly Water (Present/Absent): I don’t tick this activity when I consume alcohol or a few other sweetened drinks. I currently do not drink coffee but I consider water and tea as water for our purposes.

7.2 Causal Model

Since we can’t identify the causes from the data, we have to rely on a causal diagram. We create this directed acyclic graph (DAG) by leaning on our expert knowledge and drawing on scientific research.

Figure 7.1: Causal diagram drawn using the DAGitty website.

A tremendous amount of information is coded into this relatively simple graph. Here are some claims being made by the graph:

  • How I slept the night before influences the probability of moving my body, engaging in mindfulness practices and eating healthy food. Note that the absence of arrows mean something. The model doesn’t propose an association between sleep and my social habits.
  • Seeing people is associated with what I eat and drink.
  • Every variable directly influences affect.

Note that here are any DAGs possible and it is far from complete. We will formally assess the validity of our causal assumptions in the following sections.

7.3 Exploratory Data Analysis

Our data ranges from 2022-04-15 to 2023-04-10 for a total of days of observation.