Understanding and visualizing travel emotions

Background

One of the most challenging tasks for those interested in understanding human activity and behavior is the tracking of individual emotions over time. In several recent projects, we have used our Daynamica smartphone app to ask users to tell us about their emotional state during each of the daily trips and activities that was detected by the app. Following established protocols, we asked users to rate their level of two positive (Happy, Meaningful) and four negative (Sad, Pain, Tired, Stressed) emotions on a scale from 1 (lowest intensity) to 7 (highest intensity). This post gives a quick overview of the resulting data, and shows some ways of visualizing them.

The Data

A sample of the data for one individual is shown below. Note that the reported emotion levels are associated with given trips or activities (e.g., Home, Eat Out, Car, Walk) which are of varying duration. But while we do not have regularly-measured emotion data, we can aggregate across multiple days of data to (or groups of individuals) to gain insight about emotional states over time.

Trip.Activity Start End Happy Meaningful Sad Tired Stressed Pain
Home 2016-10-26 15:48:00 2016-10-27 08:11:00 7 7 1 3 1 1
Home 2016-10-29 07:44:00 2016-10-29 11:22:00 5 3 1 4 5 2
Home 2016-10-29 11:28:00 2016-10-29 15:45:00 5 4 3 1 1 2
Car 2016-10-29 15:45:00 2016-10-29 16:38:00 7 7 1 4 1 3
Eat Out 2016-10-29 16:38:00 2016-10-29 19:00:00 7 6 1 1 1 1
Home 2016-10-29 19:35:00 2016-10-30 08:47:00 7 4 1 1 1 1
In Vehicle 2016-10-30 08:47:00 2016-10-30 08:57:00 7 7 1 1 1 3
Walk 2016-10-30 08:57:00 2016-10-30 08:58:00 7 7 1 1 1 3
Other 2016-10-30 08:58:00 2016-10-30 11:02:00 7 7 1 1 1 5
Walk 2016-10-30 11:02:00 2016-10-30 11:06:00 7 7 1 1 1 1

Individual emotion plots

First, we start by visualizing data for a single individual, aggregated over the time that they were asked to provide data (for this study, approximately two weeks). Since emotions are recorded at irregularly spaced intervals, we start by “filling in” emotional states for every hour. There are many ways one could do this, but we assumed that the emotions associated with a given trip or activity were constant during the time interval covered by that trip or activity.

Next, we aggregate across days by taking the average emotion level at every hour. However, reporting the simple average is somewhat problematic because different people have different “baseline” levels of each emotion. Hence, we scale each emotion to have mean zero and unit standard deviation.

Our data, then, can be shown as follows. More intense colors correspond to higher levels of the corresponding emotion:

emo-rect-1

But we can do more! By switching to polar coordinates, we can depict the same data with concentric circles showing the various emotions and angle displaying hour of the day, similar to a 24-hour analog watch or clock face.

emo-target-1

Yet another circular representation puts each emotion on a wedge of a single circle:

emo-pie-1

Comparisons

One of the benefits of visualizing emotional “trajectories” in this way is the ability to compare different groups of individuals. Below, we compare those who average more than 30 hours at work per week to those averaging less than 10. It is apparent that those working more are more tired, in less pain, and have fewer happy and meaningful moments. Interestingly, and perhaps somewhat counter-intuitively, stress levels are not markedly different between the groups.

emo-compare-1

Conclusions

Smartphone-derived human activity data can provide interesting insights into well-being and decision-making processes. The data are multi-dimensional and complex; this post only scratches the surface of what is possible. There are also a lot of open analysis questions: for instance, how do we statistically compare “emotion-time” patterns visualized in this post, to assess whether two individuals or groups of individuals are significantly different?

Code and Data

The analyses and plots presented in this post were done using R, with a heavy reliance on the dplyr, tidyr, lubridate and ggplot2 packages. While the data are not publicly available, we are currently in the process of compiling our code into an online repository that we plan to make publicly available at a later date.