This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in the Journal of Medical Internet Research, is properly cited. The complete bibliographic information, a link to the original publication on http://www.jmir.org/, as well as this copyright and license information must be included.
Work stress affects individual health and well-being. These negative effects could be mitigated through regular monitoring of employees’ stress. Such monitoring becomes even more important as the digital transformation of the economy implies profound changes in working conditions.
The goal of this study was to investigate the association between computer mouse movements and work stress in the field.
We hypothesized that stress is associated with a speed-accuracy trade-off in computer mouse movements. To test this hypothesis, we conducted a longitudinal field study at a large business organization, where computer mouse movements from regular work activities were monitored over 7 weeks; the study included 70 subjects and 1829 observations. A Bayesian regression model was used to estimate whether self-reported acute work stress was associated with a speed-accuracy trade-off in computer mouse movements.
There was a negative association between stress and the two-way interaction term of mouse speed and accuracy (mean −0.32, 95% highest posterior density interval −0.58 to −0.08), which means that stress was associated with a speed-accuracy trade-off. The estimated association was not sensitive to different processing of the data and remained negative after controlling for the demographics, health, and personality traits of subjects.
Self-reported acute stress is associated with computer mouse movements, specifically in the form of a speed-accuracy trade-off. This finding suggests that the regular analysis of computer mouse movements could indicate work stress.
Stress in the workplace is responsible for over 120,000 deaths and US $187 billion in annual health care spending in the United States [
For this study, we hypothesized that there is an association between stress and computer mouse movements. Our hypothesized association is based on the theory of neuromotor noise [
In short, the previous literature suggests that stress induces neuromotor noise, resulting in a speed-accuracy trade-off in motor movements. This trade-off is particularly documented in rapid aimed movements [
A 7-week longitudinal field study was conducted at a large European technology company. The company’s human resources director asked 496 employees from different service units (ie, accounting, human resources, information technology, marketing, quality management, logistics, and business development) to participate through an email invitation. The invitation described the study’s objective of understanding the association between computer mouse movements and work stress.
Subjects were not offered financial incentives. However, they were invited to a debriefing event at the end of the study, where the aggregated results were presented. Further, their self-reports were made available to them through graphical diagrams so they could monitor their stress levels over the course of the study.
Among all invited employees, 71 subjects decided to participate. They installed our study software by clicking on a link in the invitation. When subjects first opened the study software, a tutorial explained how the software was used to report stress. During the 7-week study period, the study software asked subjects twice a day to report their stress level. The timings were randomly triggered by our software, namely, once between 9 AM and 11 AM and once between 2 PM and 4 PM. Prior to these self-reports, our software recorded all computer mouse movements for 30 minutes. If subjects were not using their computer at that time (eg, due to a meeting), then no data were recorded.
Data about subjects’ computer mouse movements and self-reports were securely transferred to a server at the organization, from which they were gathered by our research team to perform subsequent analyses. At the beginning of the study, subjects were further asked to report their sociodemographics (ie, age, gender, and education), behavioral attributes regarding health and nutrition (ie, sports, nutrition, smoking, and drinking habits), and expression of the big five personality traits as measured by an established inventory [
Variables and descriptions.
Variable | Description | |
|
|
|
|
Valence | Self-reported valence on a scale from 1 (low) to 7 (high) |
|
Arousal | Self-reported arousal on a scale from 1 (low) to 7 (high) |
|
Stress | Dummy with 1 if valence <4 and arousal >4 (stress), 0 otherwise (no stress) |
|
|
|
|
Speed | Distance computer mouse is moved divided by the duration of the movement |
|
Accuracy | Proportion of mouse events where the movement direction remained equal along the x-axis and y-axis |
|
|
|
|
Clicks | Proportion of mouse tracks with clicks in a recording |
|
Wheels | Proportion of mouse tracks with wheels in a recording |
|
|
|
|
Weekday | Categorical {1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday and Sunday} |
|
Daytime | Dummy with 1 if recording was in the morning, 0 otherwise (in the afternoon) |
|
|
|
|
Age | Subject age |
|
Gender | Dummy with 1 if male, 0 otherwise (female) |
|
Education | Dummy with 1 if university degree, 0 otherwise (ie, high school or lower) |
|
|
|
|
Sport | Hours of sport per week |
|
Nutrition | Number of fruits or vegetables consumed per day |
|
Alcohol | Categorical {1: never, 2: 2-4 times per month, 3: 2-3 times per week, 4: more than 4 times per week} |
|
Smoking | Categorical {1: daily, 2: occasionally, 3: not anymore, 4: never smoked} |
Personality traits | The big five personality traits, each measured on a scale from 1 (low expression of the trait) to 10 (high expression of the trait), based on an established inventory [ |
A Java application was developed to record computer mouse movements (ie, timestamp and x- and y-coordinates) and mouse events (ie, movement, click, and wheel). The application was built on the Windows operating system’s standard software drivers with a sample rate of approximately 125 Hz. Computer mouse movements were recorded for 30 minutes and processed in the following way. Each recording was split into separate trajectories, where a trajectory started with a mouse movement and ended with a different mouse event (ie, a click or wheel). Thereby, trajectories were only considered if their duration was between 1 and 10 seconds. This approach was beneficial, as it omitted trajectories that were extremely short or included temporary phases where the mouse was not moving. For each trajectory, two variables were computed: (1) mouse speed, which is the average movement speed, and (2) mouse accuracy, which is the proportion of mouse events where the direction of the movement remained equal along the x- and y-axes (ie, the proportion of times the movement direction was
Mouse speed was computed as the total distance the mouse moved between the start time
Mouse accuracy is the relative frequency of how often the movement in x- and y-directions was
where the variable
Accordingly, the larger the accuracy value is, the less the movement direction was altered. If the value for accuracy is 1, then the movement direction was never altered, and if the value for accuracy is 0, then the movement direction was always altered. In other words, the more accurate movement was the one with fewer corrections. This directly relates our measure of accuracy to the theory of neuromotor noise, which predicts more corrections as the movement speed is increased.
The proportion of direction changes is commonly used as a measure of accuracy in related work [
Acute stress was measured according to the circumplex model of affect [
A logistic regression model was estimated with stress as the dichotomous outcome variable and with features from computer mouse movements as the independent variables. The model is specified as follows:
where
Further independent variables were included in the above regression model as part of the sensitivity analysis. For instance, to control for mouse usage, we computed the number of events where the mouse was clicked or wheeled. Note that access to other human-computer interactions (eg, keyboard strokes) was not granted in this study due to privacy concerns.
A Bayesian approach was used for model estimation. Compared to classical statistics, the Bayesian approach requires the specification of priors for all model parameters. When choosing flat priors, the classical and Bayesian approaches are the same. However, when choosing a Bayesian prior (eg, a normal prior), the results are different, and sign errors are less frequent with a Bayesian prior [
The model was estimated with Markov chain Monte Carlo using four chains. Each chain performed 2000 iterations divided into 1000 iterations for a warm-up and 1000 iterations for sampling. Samples were drawn with the No-U-Turn Sampler [
Statistical analysis was performed with the programming language R, version 4.0.2 (The R Foundation), and the probabilistic programming language Stan, version 2.21.0 [
All participants deciding to participate were included in the study (ie, no additional inclusion or exclusion criteria were applied). Our raw data contained 2029 recordings from 71 subjects. The number of recordings per subject varied due to absences or because the subjects decided to stop participating. Further, recordings were excluded when no computer mouse movements were recorded (5 recordings), the recorded computer mouse movements contained tracking errors (ie, incorrect time stamps) (92 recordings), or when the recordings contained less than 10 computer mouse trajectories (200 recordings). This led to the removal of 297 recordings from 62 subjects—between 1 and 12 per subject—and the exclusion of 1 subject from the study.
Preprocessed data and a script to replicate all model results are provided [
Our results are based on 70 subjects and 1829 recordings (mean 26.13, SD 14.33). Subjects were between 20 and 61 years old, with a median age of 39.5 years (IQR 31.0-49.0). Further, 46% (32/70) of the participants were female, and 59% (41/70) held a university degree; all others had high school diplomas or lower. Recordings were roughly balanced by daytime hours (951/1829, 52.0% in the morning and 878/1829, 48.0% in the afternoon) and weekdays (329/1829, 18.0% to 384/1829, 21.0% per weekday and 18/1829, 1% on the weekend).
Both valence and arousal varied across subjects (see
Perceived valence and arousal by subject. Shown are the average self-reported valence and arousal levels by subject in the field study. Red points indicate high levels and blue points indicate low levels of average stress.
It was hypothesized that stress is characterized by a speed-accuracy trade-off. This trade-off is illustrated in
The estimated parameters of mouse speed and accuracy were as follows. The individual parameters of mouse speed (β1) and accuracy (β2) were not significant based on the observation that the 95% HPDIs include zero (see
Illustrative examples of the speed-accuracy trade-off in computer mouse movements. Shown are typical computer mouse movements (blue dot: beginning of movement; red dot: click) from the field study. Circles correspond to recordings at 125 Hz. When subjects perceived no stress, computer mouse movements were typically not characterized by a speed-accuracy trade-off. When subjects perceived stress, computer mouse movements were typically characterized by a speed-accuracy trade-off. Mouse speed and accuracy were standardized to indicate the direction of the trade-off; that is, high speed (+) and low accuracy (−) or low speed (−) and high accuracy (+).
Association between work stress and computer mouse movements. Shown is the estimated effect (posterior and prior density and mean as solid and dashed grey lines, respectively, and 95% highest posterior density interval as shaded area) of mouse speed (β1), mouse accuracy (β2), and the two-way interaction between mouse speed and accuracy (β2).
Probability (Prob.) of perceived stress based on mouse speed and accuracy. Shown is the partial dependence of stress on mouse speed and accuracy in the range of −2 SD to +2 SD. Red areas indicate high levels and blue areas indicate low levels of stress.
The sensitivity of the estimated parameters was assessed in the following ways. First, different processing of the data led to conclusive findings. In the above analysis, recordings were removed when fewer than 10 computer mouse trajectories were counted over 30 minutes. When varying this number, the estimated parameter of the mouse speed-accuracy trade-off remained stable (see
Second, the sensitivity of the estimated parameter for the speed-accuracy trade-off was assessed with respect to the inclusion of varying slopes for computer mouse movement variables and additional controls, such as mouse events and sociodemographics. Including varying slopes or adding more controls led to comparable estimates for the parameter of the mouse speed-accuracy trade-off (see
Third, the association of computer mouse movements with valence, arousal, and a discrete measure of stress (defined as arousal – valence + 6) was estimated. Results from Poisson regressions with the same model specification showed no significant associations but a tendency that arousal and the discrete measure of stress were negatively associated with the speed-accuracy trade-off (see
Fourth, the possibility of selection bias was investigated, with a statistical comparison between those subjects with few (n≤10) and many (n>10) recordings. The proportion of recordings with stress from subjects with few recordings (6/43, 14%) was higher than the proportion of recordings with stress from subjects with many recordings (188/1986, 9.5%). However, the difference was not statistically significant (χ21=0.5,
The goal of this study was to examine whether computer mouse movements indicate work stress. Data from a 7-week longitudinal field study supported the hypothesis. Despite the heterogeneity of computer tasks and the resulting complexity of computer mouse movements, we found a significant association with work stress. That is, work stress was characterized by a speed-accuracy trade-off in computer mouse movements.
This is the first study to infer stress from the computer mouse in the field (ie, at the workplace). In prior work, lab studies were conducted to investigate the association between stress and the use of the computer mouse [
A drawback of our field study in comparison to the lab studies is that we are not able to estimate a causal link. The reason is that there are potentially unmeasured confounders. In particular, computer mouse movements as well as stress may depend on the difficulty of the task, with more difficult tasks resulting in higher levels of stress. In the lab, it is possible to control which task is performed, whereas this is not possible in the field without obtrusive monitoring of tasks. However, precisely because unobtrusive and continuous monitoring of tasks is not feasible in the field, computer mouse movements may be a good proxy for how stressful a task is perceived and may thus provide an indirect way to measure stress.
Monitoring of computer mouse movements provide a number of benefits for stress management in the workplace. Most office work involves computer tasks; as such, computer mouse movement data are readily available. Unlike other forms of stress monitoring, computer mouse movements present a viable tool for monitoring stress at scale because they can be collected in an unobtrusive fashion and continuously over time [
Our study also has limitations. First, our work constitutes an observational study with an explanatory analysis of the data. As a consequence, a causal interpretation of the estimated association is precluded. Second, computer mouse movements were only linked to the presence of stress, which was defined according to the circumplex model of affect [
To summarize, the findings of this study suggest that the computer mouse can be used to infer work stress. These findings could be combined with findings from other forms of human-computer interactions (eg, computer trackpads [
Supplementary figures for descriptives and sensitivity analyses.
highest posterior density interval
We would like to thank Andreas Filler for developing the software that allowed us to perform the computer mouse movement and self-report recordings. NB and SF acknowledge funding from the Swiss National Science Foundation outside of this study.
EF and TK are affiliated with the Center for Digital Health Interventions, a joint initiative of the Department of Management, Technology and Economics at ETH Zurich and the Institute of Technology Management at the University of St. Gallen, which is funded in part by the Swiss health insurer CSS. EF and TK are also cofounders of Pathmate Technologies, a university spin-off company that creates and delivers digital clinical pathways. However, Pathmate Technologies was not involved in the study described in this paper.