Introduction

How we feel is profoundly linked to how we think and process information1,2. Experimentally-induced negative affective states such as stress3, anxiety4,5, or sadness6 impair cognitive performance in a wide range of tasks measuring memory, working memory capacity, and executive functions. Conversely, positive affective states like contentment tend to enhance cognitive resources and thought-action repertoires7. Longitudinal studies using cross-lagged panel models and related frameworks have furthered knowledge in this area showing that depressive symptoms and cognition covary within-person8 and have bidirectional relationships911. However, all these approaches rely on lab-based assessments and synthetic stimuli with limited implications for understanding the relationship between affective shifts and cognitive performance in the real world and the development of just-in-time interventions.

Ecological momentary assessment (EMA) can help to address this by allowing the collection of high-frequency data in shorter periods of time from participants as they go in their daily life12. The resulting time series are particularly suitable to distinguish trait and state-like mechanisms and can provide temporal evidence for causation13. However, to date, research using EMA has yielded mixed findings regarding within-person coupling between affect and cognition (available studies in this area are summarized in Supplementary Table 1). Momentary increases in negative affect and/or decreases in positive affect are associated with decline in working memory performance in younger adults (N = 101 with 100 observations each with a 1.5-day lag and assessments carried out in-lab)14,15, older adults (N = 92 with only 7 observations in 24 hours)16, and children (N = 109 with around 60 observations each across 31 days)17. Other studies have failed to detect any within-person associations between affect and cognition1820, however these involved relatively fewer observations per participant (i.e., 5, 30, and a mean of 23 ± 18). Results in the opposite direction have also been reported. For example, when examining adults from the general population, in one study, stress was associated with better visuospatial processing (N = 122 with 3 daily observations across 10 days21, and in another negative mood was linked to better inhibitory control (N = 106 with 2 daily observations across 5 days)22. A study in bipolar disorder (N = 46 with 1 daily observation across 14 days) showed mixed results, with higher happiness coupled with faster processing speed but higher stress coupled with better working memory23.

Temporal associations are critical for testing causal relationships in time series data but have been much less studied due to the increased power required to estimate them24. One study in an adult sample showed that stress anticipation in the morning predicted working memory deficits later that day (N = 240 with 7 daily observations across 14 hours)25. In contrast, an exploratory analysis within the study of Brose et al. (2012)14 did not yield any temporal associations between negative affect, subjective control of attention, motivation, and working memory. Although that study included a moderate sample of 101 younger adults, each with 100 observations, assessments were conducted every 1.5 days, which may have introduced a lag that was too long, potentially causing effects to vanish14. Two studies using clinical populations revealed mixed findings. In bipolar disorder (N = 46 with 1 daily observation across 14 days), mania at one point in time predicted slower processing speed at the next assessment; however sadness predicted better subsequent visual working memory23. In a series of 7 single-case studies of older adults with both depression and cognitive impairment (with 63 observations each, one per day), negative affect predicted better working memory later that day in one patient, and visual learning predicted higher positive and lower negative affect in another patient, in the context of mostly null results26. In summary, across studies, contemporaneous and temporal results are scant and inconclusive. Crucially, with the exception of the exploratory analysis in Brose et al. (2012)14 and the case-study series of 7 depressed patients in Tieks et al. (2022)26, no study has assessed potential directed influences of cognition on affect. Furthermore, all research to date has involved traditional forms of cognitive testing, leaving an open question as to whether negative affect is associated with decrements in real-world cognitive function.

The proliferation of smartphones in global societies has opened up a new area of research that aims to leverage data generated passively from digital devices to understand the thoughts, feelings, behaviors, and cognitive functioning of individuals in more naturalistic settings. Using such data improves the ecological validity of research and may also help reduce the burden that repeated testing placed on participants, which has likely restricted the number of assessments gathered per person in prior EMA studies (Supplementary Table 1). Recent work examined whether the time taken to complete surveys or ‘digital questionnaire response time’ (DQRT)27 could serve as a useful proxy for cognitive processing speed2729. DQRT demonstrated adequate reliability, convergent validity with gold-standard processing speed tests (i.e., Symbol Search, Trail Making Test), and divergent validity with measures of inhibition (e.g., Go/No-Go) and model-based planning27,28. Moreover, it has been shown that DQRT can be derived from EMA data, which also covaries within-person over time with gold-standard processing speed tests (i.e., Symbol Search, Trail Making Test)27,28 and fatigue28. DQRT also has potential clinical utility; in a prospective study, a combination of different metrics related to online survey completion times predicted mild cognitive impairment several years in the future30.

The present study aimed to use repeated assessments of affect and DQRT to test for between-person and contemporaneous relationships between affect and cognitive processing speed using a total of 914 independent participants that completed between 63 and 126 assessments each–Fig. 1a. Leveraging high-density sampling of cognition, we also aimed to test for Granger-causality13–that is, if prior information about affect can predict changes in DQRT hours later beyond previous DQRT values, and vice versa. We first examined a single EMA dataset (N = 442) concerning negative and positive affect over 8 weeks, finding robust evidence for both between and within-person associations between affect and DQRT. We also found evidence that mood changes temporally precede cognitive slowing, providing a candidate causal mechanism for their association. We replicated our findings in two datasets (N = 172 and N = 195) that assessed different mood-related items, were gathered over different timescales, and response modalities (slider, radio button). In comparison, within-person associations between affect and a gold-standard measure of cognitive processing speed (the Trail Making Test) were not significant.

Microlongitudinal design and undirected associations between affect and cognitive processing speed as measured by digital questionnaire response time (DQRT).

(a) EMA protocols and example items and response scales across the three datasets used. Dataset 1 involved the assessment of 16 affective states twice daily (morning and evening) for 8 weeks in a 7- point Likert scale. Dataset 2 included the evaluation of 7 affect-related experiences three times daily (morning, afternoon, and evening) for 6 weeks on an 8-point Likert scale. Dataset 3 included the assessment of 14 depressive symptoms twice daily (morning and evening) for 8 weeks on an 11 -point visual analogue scale. For each time point, DQRT was calculated as the mean time to respond to EMA items. (b) Between- and within-person contemporaneous associations. Plots display results from multilevel vector autoregressive models examining the relationship between affect and DQRT. Between-person partial correlation coefficients (in purple) are the average of two regression parameters indicating how well the mean of each EMA item predicts the mean of DQRT and vice-versa, controlling for temporal (autoregressive and cross-lagged) effects as well as age and gender. Within-person contemporaneous partial correlation coefficients (in blue) were calculated in a second step using the residuals from the initial models and represent the average of two regression parameters, indicating how well each EMA item predicts DQRT and how well DQRT predicts each EMA item in the same time window. Circles represent negative affect items. Triangles represent positive affect items. Filled shapes indicate results that survive FDR-correction for multiple comparisons using an alpha level of P < 0.05. Annotations: Can’t conc.: can’t concentrate, EMA: ecological momentary assessment, DQRT: digital questionnaire response time, FDR: false discovery rate, Med.: median, No interest.: not interested, Non-sig.: non-significant, Obs.: observations, Rep. thought: repetitive thought.

Results

We analyzed data from three distinct EMA datasets collected using a freely available smartphone app, Neureka (https://www.neureka.ie). Dataset 1 included 753 participants (70.3% female, mean age = 42.1 ± 16.6 [18 – 82]) of which 25.6% were university students that were financially compensated for their time. The rest were citizen scientists, who downloaded the Neureka app and completed the experiments for free. All of them tracked their positive and negative affect twice daily (i.e., every 12 hours) over 8 weeks, responding to 16 EMA items on a 7-point Likert scale. Dataset 2 involved 173 participants (68.8% female, mean age = 52.8 ± 12.6 [18 – 82]) who rated their experience over the last 2 hours in a different set of 7 affect-related items three times daily (every 5 hours) for 6 weeks on an 8-point Likert scale. Dataset 3 included 195 participants (76.4% female, mean age = 54.3 ± 12.1 [19 – 82]) who assessed their momentary depression symptoms twice daily across 14 items over an 8-week period using a 11-point visual analogue scale. This EMA item set was based on the Quick Inventory of Depressive Symptomatology, self-report (QIDS-SR-1631), omitting the item about suicidality. Notably, the different EMA sets had only partial overlap in terms of the items used. All three assessed feeling anxious and guilty using identical language, and other items using synonyms (e.g., sadness as ‘down’, ‘happy vs. sad’, and ‘sad’). See Methods for a complete list of EMA items assessed. See Supplementary Table 2 for samples’ demographics and Supplementary Table 3 for participant overlap across datasets.

For each participant and each assessment session, we calculated the average time taken to respond to the EMA items, i.e., the DQRT, as a proxy for cognitive processing speed27. Fig. 1a provides an overview of the EMA datasets and total observations gathered. Every second day, participants in dataset 3 also completed an active gamified version of the Trail Making Test – part B (Trails-B), a gold-standard task to measure cognitive processing speed32. This task involved tapping letters and numbers in an alternating sequence (e.g., 1, a, 2, b, 3, c, etc.), with higher completion times indicating worse performance32. Descriptive statistics for participants’ responses in the EMA questionnaires are summarized in Supplementary Table 4. The distribution of affect data is plotted in Supplementary Figures 13. The distribution of DQRT and Trails-B data is plotted in Supplementary Figure 4a and b.

Each of the DQRT and Trails-B time series were detrended to adjust for practice effects by regressing them on temporal variables (See Methods and Supplementary Figure 4c and d). Then, we evaluated between-person and within-person contemporaneous and temporal associations between each EMA item and DQRT separately by implementing two-step multilevel vector autoregressive models as validated in Epskamp, et al. 13, and controlling for age and gender. Exploratory analyses tested for interaction effects. Prior to analyses, all data were grand-mean scaled, and predictors were also within-person centered.

Using dataset 3, we tested for similar associations between affect and an active measure of cognitive processing speed, Trails-B from the Trail Making Task. This analysis had substantially less power than the DQRT analysis as Trails-B was assessed every 2nd day, and not 2 or 3-times per day as per DQRT. First, we examined associations between DQRT and Trails-B performance through Spearman correlations and multilevel mixed-effects models33. Then, we explored the relationship between each EMA item and Trails- B performance using multilevel mixed-effects models33 and compared the results to those of DQRT. To make a fair comparison, we downsampled the DQRT data to the sampling rate of Trails-B assessments. All these analyses controlled for age and gender. We assessed the consistency of each measure using the Intraclass Correlation Coefficient (ICC)34.

Negative affect is associated with slower DQRT and positive affect with faster DQRT between- and within-person

Between-person partial correlations between each EMA item and DQRT from multilevel vector autoregressive models were derived by averaging two regression parameters: one indicating how well the mean of each EMA item predicts the mean of DQRT, and the other indicating how well the mean of DQRT predicts the mean of each EMA item, while controlling for temporal (autoregressive and cross-lagged) effects, age and gender. Within-person contemporaneous partial correlations were calculated in a subsequent step using residuals from the initial models. Here, two parameters were averaged: how well each EMA item predicts DQRT and how well DQRT predicts each EMA item at a given time point for an average participant13. As the residuals are temporally unrelated, their association is assumed to represent a contemporaneous link35. All P-values were corrected for multiple comparisons using the FDR method36, with a significance threshold of P < 0.05.

Between-person associations

In dataset 1, higher scores in all negative-valenced EMA items were significantly associated with slower DQRT (0.199 < partial correlation < 0.336, PFDR < 0.05). The strongest effect was observed for feeling indecisive, followed by worried, anxious, down, restless, lonely, irritated, guilty, and agitated. Conversely, higher scores in all positive EMA items from dataset 1 correlated significantly with faster DQRT (-0.278 < partial correlation < −0.344, PFDR < 0.05), with the strongest effect for feeling energetic, followed by content, happy, strong, cheerful, enthusiastic, and talkative.

In dataset 2, higher scores in 5 out of 6 negative EMA items were significantly associated with slower DQRT (0.193 < partial correlation < 0.305, PFDR < 0.05), with the strongest effects for feeling anxious, tired, having experienced stressful events, feeling bored, and guilty. Having repetitive thoughts showed no association with DQRT at the between- person level (PFDR > 0.05). Regarding positive affect, feeling happy was significantly associated with faster DQRT (partial correlation = −0.251, PFDR < 0.05).

In dataset 3, all EMA items, which were momentary versions of the QIDS-SR-1631 depression scale and all negatively valenced, were significantly associated with slower DQRT (0.337 < partial correlation < 0.564, PFDR < 0.05). These items, ranked by effect size, included feeling slow, inability to concentrate, feeling tired, inability to make decisions, feeling sad, feeling worried, lack of interest in things, feeling stressed, inability to enjoy things, feeling anxious, restless, irritated, guilty, and worthless.

Between-person associations are visualized in Fig. 1b and detailed in Supplementary Table 5. As the datasets partially overlapped (Supplementary Table 3), we tested whether analyzing unique (i.e., non-overlapping) samples would change the results. We found unique samples to lead to highly similar outcomes (Supplementary Figure 5), suggesting that results were not driven by a minority of participants repeated across datasets. Overall, persons with higher average negative affect and lower positive affect during the study period also showed slower cognitive processing speed, as measured passively with DQRT. This was consistent for the three datasets, featuring different EMA items and response scales. The largest effect sizes in between-person associations were found for dataset 3 which uses a standardized scale to measure depression symptoms.

Contemporaneous associations

In dataset 1, increases in all negative EMA items were significantly associated with slower DQRT within-person, measured at 12-hour intervals (0.056 < partial correlation < 0.129, PFDR < 0.05). The strongest effect was found for feeling down, followed by feeling worried, indecisive, irritated, anxious, agitated, restless, lonely, and guilty. Additionally, increases in all positive EMA items were associated with faster DQRT within 12-hour windows (-0.104 < partial correlation < −0.135, PFDR < 0.05). The strongest effects were observed for feeling energetic, cheerful, enthusiastic, happy, strong, content, and talkative.

Dataset 2 replicated these findings; increases in all negative EMA items were significantly associated with slower DQRT across ≈8-hour intervals (accounting for overnight lags, see Methods) (0.049 < partial correlation < 0.105, PFDR < 0.05). The strongest effects were found for having repetitive thoughts, followed by having experienced stressful events, and feeling bored, anxious, guilty, and tired. Increases in feelings of happiness were associated with faster DQRT within ≈8-hour intervals (partial correlation = −0.05, PFDR < 0.05).

Finally, dataset 3 provided further corroboration of our findings. Increases in 11 of the 14 negative EMA items were significantly associated with slower DQRT within 12-hour windows (0.015 < partial correlation < 0.125, PFDR < 0.05). Items included feeling tired, slow, lack of interest in things, inability to concentrate, feeling anxious, worried, sad, inability to make decisions, feeling stressed, irritated, and restless. The inability to enjoy things and feelings of guilt and worthlessness were not associated with DQRT in this dataset (PFDR > 0.05).

Contemporaneous associations are shown in Fig.lb. and detailed in Supplementary Table 6. Results were similar when examining unique participants per dataset (Supplementary Figure 5). In summary, with few exceptions, within-person fluctuations in affect were coupled with cognitive processing speed as measured by DQRT across different time windows (12 hours and ≈8 hours).

Increases in negative affect and decreases in positive affect Grangercause slower DQRT

Temporal effects were quantified through standardized beta coefficients derived from the first step of multilevel vector autoregressive models, where each EMA and DQRT variable at one time point was regressed on the lagged value of the other variable, controlling for its own lagged value (autoregressive effect) in addition to age and gender. According to the Granger causality hypothesis37, directed associations identified in these models can be interpreted as potential causal pathways, as they satisfy the essential temporal requirement for causation: that the cause must precede its effect13. P-values were corrected using false discovery rate (FDR) method with a significance threshold of P < 0.05

Affect Granger-causing subsequent DQRT

In dataset 1, increases in 7 out of 9 negative-valenced EMA items predicted slower DQRT at the subsequent 12-hour assessment (0.011 < β < 0.036, PFDR < 0.05). The strongest effect was found for feeling worried, followed by anxious, irritated, agitated, restless, guilty, and down. Feelings of loneliness and indecisiveness were not associated with DQRT (PFDR > 0.05). In addition, increases in 5 out of 7 positive EMA items, including (in order of relevance) feeling content, energetic, happy, strong, and enthusiastic, predicted faster DQRT at the following assessment (-0.012 < β < −0.022, PFDR < 0.05). No associations were found for changes in feeling cheerful or talkative (PFDR > 0.05).

In dataset 2, feeling anxious and guilty, and having experienced stressful events predicted slower DQRT at the next ≈8-hour assessment, in that order (0.025 < β < 0.041, PFDR < 0.05). Experiencing repetitive thoughts, feeling bored, and feeling tired were not temporally linked to DQRT (PFDR > 0.05). Regarding positive affect, feeling happier predicted faster DQRT at the next assessment (β = −0.027, PFDR < 0.05).

In dataset 3, increases in 11 out of 14 negative EMA items predicted slower DQRT 12 hours later (0.028 < β < 0.067, PFDR < 0.05), in the following order: feeling worried, anxious, worthless, stressed, sad, restless, irritated, inability to enjoy things, lack of interest in things, inability to concentrate, and feeling guilty. An inability to make decisions, feeling tired and feeling slow did not predict subsequent DQRT (PFDR > 0.05). These findings mirror the lack of evidence for Granger causation for indecision found in dataset 1 and the lack of an effect of feeling tired in dataset 2.

Regarding the covariate effects, DQRT showed significant autoregressive effects in datasets 1 (βmean = 0.014, standard deviation [SD] = 0.001, PFDR < 0.05) and 2 (βmean = 0.025, SD = 0.001, PFDR < 0.05), but not 3 (βmean = −0.016, SD = 0.001, PFDR > 0.05). Age was associated with slower DQRT (dataset 1 : βmean = 0.2, SD = 0.016; dataset 2: βmean = 0.254, SD = 0.018; dataset 3: βmean = 0.166, SD = 0.021, PFDR > 0.05), indicating that older adults are slower overall, as previously reported27. Finally, no effects of gender on DQRT were found (all P > 0.05). Directed effects of affect on DQRT are summarized in Fig. 2a and detailed in Supplementary Table 7. Results were consistent for nonoverlapping samples (Supplementary Figure 5).

Directed associations between affect and cognitive processing speed as measured by digital questionnaire response time (DQRT).

(a) Affect Granger-causing subsequent DQRT. Plots show standardized beta coefficients with 95% CI derived from multilevel vector autoregressive models assessing the effect of lagged EMA variables on DQRT controlling for mean EMA value across the study period, age, and gender. (b) DQRT Granger-causing subsequent affect. Here, the reverse associations are shown, indicating the beta coefficients with 95% CI derived from multilevel vector autoregressive models assessing the effect of lagged DQRT on EMA variables controlling for mean DQRT value across the study period, age, and gender. Each dataset featured different assessment intervals (12, ≈8, and 12 hours, respectively). Dataset 1 included 753 participants with a total of 65,541 observations (median = 90, range = 56 – 112). Dataset 2 included 173 participants with a total of 15,598 observations (median = 88, range = 63 – 126). Dataset 3 included 195 participants with a total of 16,729 observations (median = 86, range = 56 – 110). To ensure that results were not driven by a minority of participants overlapped across datasets (Supplementary Table 3), these analyses were repeated with unique participants by assigning those in multiple datasets to the smaller dataset and re-estimating the models. Results were consistent (Supplementary Figure 5). Circles represent negative affect items. Triangles represent positive affect items. Filled shapes indicate results that survive FDR correction for multiple comparisons using an alpha level of P < 0.05. Annotations: Can’t conc.: can’t concentrate, CI: confidence interval, EMA: ecological momentary assessment, DQRT: digital questionnaire response time, FDR: false discovery rate, No interest.: not interested, Non-sig.: non-significant, Rep. thought: repetitive thought.

DQRT Granger-causing subsequent affect

The reverse direction (i.e., the effect of DQRT on subsequent affective ratings) was not significant for any EMA item in datasets 1 and 2 (PFDR > 0.05). The association was also null for 13 out of 14 items in dataset 3, except for slower DQRT predicting feeling more restless 12 hours later (β = 0.026, PFDR < 0.05).

Negative affect showed significant autoregressive effects (dataset 1 : βmean = 0.247, SD = 0.054; dataset 2: βmean = 0.263, SD = 0.067; dataset 3: βmean = 0.267, SD = 0.092, PFDR < 0.05), indicating that the emotional state persisted over time. Autoregressive effects of similar magnitude were found for positive affect (dataset 1: βmean = 0.187, SD = 0.056; dataset 2: βhappy = 0.287, PFDR < 0.05). Older age was associated with lower negative affect (dataset 1: βmean = −0.276, SD = 0.021; dataset 2: βmean = −0.275, SD = 0.053; dataset 3: βmean = −0.204, SD = 0.039, PFDR < 0.05) and higher positive affect (dataset 1 : βmean = 0.191, SD = 0.058; dataset 2: βhappy = 0.318, PFDR < 0.05), in line with previous literature suggesting improved mental health in older adulthood38. Being female was associated with feeling less bored (β mean = −0. 15, PFDR < 0.05) in dataset 2. No other gender effects on EMA ratings were found. Directed effects of DQRT on affect are displayed in Fig. 2a and detailed in Supplementary Table 8. Similar results were found for non-overlapping samples (Supplementary Figure 5).

In summary, higher negative affect and lower positive affect predicted slower DQRT at the next assessment. This was observed across most items in all three datasets featuring differences in wording, response scales, and assessment lags (12, ≈8, and 12 hours). In contrast, reverse associations were largely non-significant, suggesting that changes in affect drive changes in cognitive processing speed, not the other way around.

Interaction results

Previous work suggests that the association between affect and cognition can vary with levels of average affect39, psychopathology23, and age16. Thus, we performed an exploratory analysis to test interactions between lagged predictors and those variables. We also tested interactions with gender as this variable has been linked to cognitive differences40. Analyses were performed with lagged predictors as this was the first step of the two-step multilevel vector autoregressive models where parameters are set13. Results can be found in the online project repository (https://osf.io/5re67/). Briefly, in dataset 1, we found significant negative interactions between EMA lagged values and EMA mean for all items (PFDR < 0.05). That is, the effect of affect variables on DQRT was smaller for those with higher average scores in negatively valenced EMA items. Likewise, effects were smaller for those with lower scores in positively valenced EMA items. In dataset 2, the same pattern of results was observed for 3 out of the 7 items, namely having repetitive thoughts, having experienced stressful events, and feeling anxious. For 2 out of the 14 items (feeling sad and worried) this was true in dataset 3.

Regarding interactions with demographic variables, the association between affect and subsequent DQRT strengthened with increasing age for 10 out of 16 items in dataset 1 (PFDR < 0.05), consistent with previous work showing that experiences of tense arousal (i.e., feeling nervous) were associated with worse working memory only in the subsample of participants older than 45 years16. However, age interactions were not observed in datasets 2 and 3 (potentially due to the inclusion of a smaller proportion of younger participants in those). Finally, we found no interactions with gender (PFDR > 0.05).

DQRT is more strongly linked to affect than a gold-standard task measuring cognitive processing speed

Dataset 3 included a task-based measure of cognitive processing speed, Trails-B32, which was gathered every 2nd day in the evening only. To test if our results extended to this active measure, we investigated the between-person and within-person contemporaneous and temporal associations between each EMA item and Trails-B performance using multilevel mixed-effects models. The dependent variable was Trails- B average completion time across 4 runs per assessment time point. The independent variables included the average EMA item score across the entire study period (between- person effect), the contemporaneous EMA rating (PM), and the EMA rating at AM (temporal effect), age, and gender. These analyses included 163 participants (122 female)–i.e., those that completed at least 50% of Trails-B assessments. This provided a total of 3,561 Trails-B observations (median = 22 runs of the game per person, range = 14 – 28). To facilitate direct comparison to our main EMA results, we down-sampled DQRT, fixing assessments to times when Trails-B was gathered and repeated the same models. These analyses were exploratory and involved a reduced number of observations; we thus report both uncorrected and FDR-corrected p-values, using a threshold of 0.05 for significance.

Association between Trails-B performance and DQRT

First, we tested how aligned the two measures of processing speed were. As shown previously27, higher DQRT showed a moderate correlation with longer completion times on Trails-B, both at the between-person (Spearman’s rho = 0.30, P < 0.001) and within-person (Spearman’s rho median = 0.31, range = −0.39 – 0.91) levels, as shown by the participants’ raw means (Fig. 3a). Results from a multilevel mixed-effects model predicting DQRT from Trails-B scores using detrended time series and controlling for age and gender likewise revealed significant between- (β = 0.330, SE = 0.066, t(152.972) = 5.028, P < 0.001) and within- person (β = 0.179, SE = 0.038, t(87.620) = 4.665, P < 0.001) associations (Fig. 3b). Age (β = −0.020, SE = 0.065, t(152.282) = −0.317, P = 0.752) and gender (β = −0.097, SE = 0.134, t(151.884) = −0.730, P = 0.467) had no significant effects in this model.

Associations with a gold-standard task measuring processing speed (Trail Making Test: Trails-B) from dataset 3.

(a) Bivariate correlations. Between-person (left panel) and within- person (right panel) Spearman’s rank correlation coefficients between non-detrended mean Trails-B performance and DQRT. (b) Multilevel mixed effects models predicting DQRT by Trails-B. The left panel shows the fixed effect of Trails-B on DQRT using detrended time series and controlling for age and gender. The right panel displays the random effect estimates. (c) Associations between affect and Trails-B (PM assessment). Standardized beta coefficients and SE derived from multilevel mixed effects models predicting Trails-B evening assessments by mean EMA ratings (between-person effect, in purple), EMA ratings at the same assessment time point (within-person contemporaneous effect, in blue), and EMA ratings in the morning (temporal effects, in yellow), controlling for age and gender. (d) Sensitivity analysis testing the association between affect and DQRT restricted to assessment time points concurrent to Trails-B (PM assessments). Standardized beta coefficients and SE derived from multilevel mixed effects models predicting DQRT evening assessments (downsampled to the days when Trails-B was performed) by mean EMA ratings (between-person effect, in purple), EMA ratings at the same assessment time point (within-person contemporaneous effect, in blue), and EMA ratings in the morning (temporal effects, in green), controlling for age and gender. (e) Internal consistency of Trails-B and DQRT. Intraclass-correlation coefficients (single raters, absolute agreement) indicate that within-individual consistency is higher in Trails-B (yellow) compared to DQRT (green). Figures show the range of Trails-B performance (left figure) and DQRT (right figure) for each individual participant ordered by magnitude of mean Trails-B performance and mean DQRT, respectively. All analyses were performed in 163 participants with a total of 3,561 observations (median = 22, range = 14 – 28). Given the exploratory nature of these analyses and the limited number of observations, P-values were not corrected for multiple comparisons (see Supplementary Tables 9 and 10 for details). Annotations: Can’t conc.: can’t concentrate, EMA: ecological momentary assessment, DQRT: digital questionnaire response time, ICC: interclass correlation coefficient, Med.: median, No interest.: not interested, Obs.: observations, Rep. thought: repetitive thought, SE = standard error, ***P uncorrected < 0.001, ***P uncorrected < 0.01, ***P uncorrected < 0.05.

Association between Trails-B and affect

At the between-person level, feeling worried (β = 0.186, Puncorrected < 0.05) and slow (β = 0.171, Puncorrected < 0.05) were associated with slower completion times on Trails-B. However, those associations did not survive correction for multiple comparisons. No significant within-person (contemporaneous or temporal) associations were found for any of the 14 items at neither alpha threshold. Higher age was associated with slower performance on Trails-B across all EMA models (βmean = 0.472, SD = 0.008, PFDR < 0.05) and gender had no significant effect (PFDR > 0.05). Detailed results are presented in Fig. 3c and Supplementary Table 9.

A sensitivity analysis suggested this is unlikely to be due to low statistical power. Using the corresponding down-sampled DQRT data, all between-person associations survived (0.249 < β < 0.462, Puncorrected < 0.05), even when FDR correcting for multiple comparisons. Contemporaneously, 11 out of 14 items were significantly associated with slower DQRT (0.046 < β < 0.081, Puncorrected < 0.05), with 6 of them surviving FDR correction. Our temporal results were the least resilient to down-sampling; only feeling more anxious (β = 0.077, Puncorrected < 0.05) in the morning was predictive of higher DQRT in the evening. However, this effect was not significant after FDR-correction. Higher age was associated with slower DQRT in the models (βmean = 0.172, SD = 0.02, PFDR < 0.05). Gender had no significant effect (PFDR > 0.05). See Fig. 3d and Supplementary Table 10 for details.

Internal consistency of Trails-B and DQRT

One potential explanation for the lack of results for Trails B is that it is more trait-like and stable than DQRT. We estimated the consistency of each measure using the ICC (single raters, absolute agreement)34. Consistency was found to be much higher for Trails-B (ICC = 0.85 [0.82 – 0.88], P < 0.001) than DQRT (ICC = 0.55 [0.50 – 0.61], P < 0.001), as shown previously27. See Fig. 3e.

In summary, despite a moderate between- and within-person association between Trails- B and DQRT, affect was not associated with performance in an active test of cognitive processing speed (except for between-person links with feeling worried or slow).

Discussion

Using a microlongitudinal design we tested if everyday changes in affect were related to changes in real world cognitive processing speed, assessed using digital questionnaire response times (i.e., DQRT). We found that this was the case; specifically, experiencing a range of negative affect states (e.g., worry, anxiety, sadness) was linked to slower cognitive processing speed between-person and within-person (both contemporaneously and temporally). The opposite was found for positive affect (e.g., happiness, contentment), which was associated with faster cognitive processing speed as indexed by DQRT. These results were replicated across three separate datasets, totaling 914 independent participants who completed between 63–126 assessments each over 6–8 weeks.

Between-person results indicate that individuals with higher average negative affect overall are slower in responding to survey items, while those with higher average positive affect are faster. This pattern of results is consistent with previous cross-sectional evidence using gold-standard cognitive measures in samples of patients with depressive symoptoms41,42. Similarly, contemporaneous associations show that when individuals experience increased negative affect relative to their own average, their processing speed slows down (and vice versa for positive affect). This aligns with prior EMA studies linking momentary decrements in affect to poorer working memory performance in healthy adults1416. However, other studies have reported null results1820 or associations in the opposite direction21,22. Notably, compared to the present study, most previous studies involved fewer participants and assessments per participant (Supplementary Table 1) and they all used active cognitive tasks. Thus, it is possible that a higher density of data and/or more naturalistic measures (such as DQRT) may be necessary to detect reliable within-person effects.

To our knowledge, this study is the first to systematically examine cross-lagged associations between affect and cognition using densely acquired data across a broad range of negative and positive affective states, in a large sample of participants. For most items assessed—70% in dataset 1, 57% in dataset 2, and 79% in dataset 3—changes in affect predicted later changes in DQRT, over and above the autocorrelation of DQRT itself, a pattern that can be interpreted as Granger causality13. Specifically, negative affect at one time point predicted slower DQRT at the subsequent measurement, whether assessed 5, 8, or 12 hours later. Conversely, higher positive affect predicted faster DQRT later in time. Overall, there was no evidence for reverse Granger causation; that is, changes in DQRT did not predict changes in negative or positive affect except for feeling restless in dataset 3. These findings suggest that negative affect might cause cognitive performance decrements.

Temporal associations were significant for most assessed items, and we did not have any prior hypotheses based on specific symptoms. However, interesting patterns emerged. The strongest predictors of subsequent DQRT were feeling worried (dataset 1), anxious (dataset 2), and worried (dataset 3), followed in effect size by other emotionally laden items such as feeling irritated, guilty, stressed, worthless, less happy, and less content. In contrast, most states associated with cognitive or deactivation features—such as indecisiveness, repetitive thoughts, boredom, tiredness, and feeling slow—did not predict future DQRT. This suggests that the emotional component may be the primary driver of the observed effects. The cognitive load and rumination related to the anticipation of negative events that is characteristic of anxiety and worry may tax cognitive resources43 with impacts that extend over time. This interpretation aligns with a previous EMA study that found stress anticipation negatively impacted working memory performance later in the day25. An alternative explanation, drawn from the depression literature, is that these effects are mediated by a neuroplasticity failure, including atrophy and disrupted functional connectivity in the medial prefrontal cortex and the hippocampus44. However, given the short timescales of the study assessments, mediation via structural atrophy seems unlikely.

An exploratory analysis of interactions revealed that the effect of lagged affect on DQRT was weaker in individuals with worse average affect overall (i.e., mean EMA value). There are many possible explanations for this result. First, it may simply be the case that the within-person effect of mood on DQRT plateaus at a certain level of mood severity and/or DQRT. This could be due to a change in variability of DQRT and or mood at higher values, akin to a ceiling or floor effect. Another possibility is that at higher levels of overall EMA values, we begin to include more severe or complex clinical phenotypes. These may be characterized by more heterogeneous affect-cognition profiles. This interpretation is grounded on prior evidence on clinical samples. In individuals with bipolar disorder, sadness has been linked to better visual working memory measured later23. Similarly, a case study of an older adult with depression and cognitive impairment found that negative affect predicted better working memory performance26. The authors have proposed that extreme affective experiences may engage emotion regulation strategies, which could enhance cognitive performance23. This hypothesis may help explain why the temporal results were attenuated at higher levels of average affect in our work. Additionally, in Bomeya et al.,23 prior mania ratings were associated with slower processing speed in bipolar patients. Although mania is a positively valenced affective state (which, in this context, might suggest an association with faster cognition), its extreme form in pathological samples can have the opposite effect. Thus, affect-cognition links may gradually shift on more symptomatic or pathological samples. Future studies should explore this possibility further.

We did not observe consistent results when examining a traditional measure of cognitive processing speed, Trails-B. Although we only gathered task data on 25% of occasions, these null results cannot be attributed to reduced statistical power, as our down-sampled DQRT data was relatively robust to the loss of within-person data assessments (although only feeling anxious remained significant in the temporal analysis). More likely, the difference in results reflects the fact that DQRT and Trails-B engage partially different cognitive processes. Trails-B is an example of ‘cold cognition’, involving multiple processes including visual search and motor speed as well as alternation skills and attention and is associated with reading level45. DQRT, in contrast, is an example of ‘hot cognition’ and involves reflecting on one’s own inner state, including emotionally-laden mood items, potentially making it more sensitive to affective influences46. Indeed, there was only a moderate correlation between Trails-B and DQRT, which suggests considerable unexplained variance. Another major difference between tasks is that T rails- B is an explicitly instructed task rather than a passive readout, meaning that participants may choose to exert greater effort to compensate for affect-related impairments. Because DQRT is measured implicitly, it may be more susceptible to fluctuations in affect. A final difference is that Trails B performance may be much more trait-like than DQRT, which was evident in differences in their ICCs. Future studies should systematically investigate these potential mechanisms.

This work has theoretical and translational relevance for clinical contexts. Cognitive deficits are a significant yet often overlooked aspect of mood disorders42,47. For instance, while cognitive impairments are well-documented in depression and impact patient outcomes48, treatments primarily focus on mood symptoms. Cognitive remission may help achieve functional recovery in depression48. Understanding how affect influences cognition may provide insights into mechanisms that extend to clinical pathology and inform the development of just-in-time interventions or psychoeducational resources.

Some limitations must be acknowledged. First, DQRT is a relatively new construct and there are few studies to date examining the precise measures involved. While intrinsically a reaction time measure, it has been used as a proxy for other factors beyond cognition, including survey response quality, careless responses, and fatigue49. In the context of affective surveys, it has been used as a measure of emotional clarity50,51, i.e., the ability to identify one’s emotions. Second, our study relies on a correlational design, limiting causal interpretations. Although Granger causality analyses provide temporal insights, experimental designs are needed to establish causality. Third, while we examined the impact of affect on processing speed, other cognitive domains may interact differently, potentially functioning as more stable traits rather than state-dependent processes. Nevertheless, processing speed is fundamental to more complex cognitive functions52. Fourth, our selection of temporal lags was arbitrary, and future research should explore whether faster or slower temporal dynamics better capture these associations. Fifth, testing these findings in well-characterized clinical populations will be crucial, particularly given evidence that results may be weaker or distinct in those with greater symptom severity overall. Relatedly, single-case analyses have provided preliminary evidence of different affect-cognition relationships in different individuals26, emphasizing the need for future idiographic modeling approaches.

In conclusion, our findings suggest a potential causal relationship in which negative affect predicts slower cognitive processing speed, when applied to the real-world task of completing digital surveys. These findings contribute to mechanistic accounts of cognitive deficits in mental health disorders that have historically been predominated by crosssectional designs and suggest a direction of causation for future research to pursue. Future research should employ experimental and clinical approaches to further validate these associations and explore their implications for assessment and intervention.

Methods

All the investigations reported here were approved by the School of Psychology at Trinity College Dublin. All participants provided informed consent in accordance with the European General Data Protection Regulation (GDPR). Data were preprocessed and analyzed using R Statistical Software (v4.1.3).

Dataset 1

Participants

A total of 753 participants (70.3%female) between 18 and 82 years (mean age = 42.1 ± 16.6) were recruited between October 2019 and September 2023 through a smartphone app, Neureka. 74.4% (N = 560) of the sample consisted of members of the general public, referred to as ‘citizen scientists’, who voluntarily downloaded the app from the app store and contributed their time to the research. Among these participants, 37 also participated in datasets 2 and 3; 69 in dataset 2; and 38 in dataset 3. The remaining 25.6% (N = 193) of the sample were university students in Ireland who were financially compensated for their participation as part of a previous study53. Demographic information is presented in Supplementary Table 2 and details on participant overlap across datasets is presented in Supplementary Table 3.

EMA assessment and procedure

Participants engaged in a ‘science challenge’ within the Neureka app called ‘Multi Mood’, which involved 8 weeks (56 days) of EMA assessments to track negative and positive affect. During the sign-up process, participants selected two 3-hour time windows (between 6:00 – 11:30 AM and 6:00 – 11:30 PM), to receive notifications to rate their current affect. Notifications were delivered randomly within these intervals, spaced approximately 12 hours apart (mean lag = 11.99 ± 0.52 hours), and participants could respond until the end of the corresponding time window. Upon receiving a notification, they were asked to rate their current affect by responding to 16 items—9 negatively valenced and 7 positively valenced affective states—on a 7-point Likert scale ranging from −3 (not at all) to 3 (very much so). They were instructed to complete all questions in one sitting. The items were always presented in the following order, using the structure ‘I feel…’: enthusiastic, irritated, cheerful, down, strong, lonely, happy, anxious, energetic, guilty, content, indecisive, talkative, restless, agitated, and worried. Participants were included in this dataset if they completed at least 50% of the assessments (56 out of a maximum of 112 possible assessments). This resulted in a total of 65,541 observations, with a median of 90 assessment sessions per participant (range = 56 – 112). Mean responses in EMA questionnaires are presented in Supplementary Table 4 and data distributions in Supplementary Figure 1.

Dataset 2

Participants

This dataset consisted of 173 citizen scientists (68.8% female), aged between 18 and 82 years (mean age = 52.8 ± 12.6) recruited through the Neureka app (see Supplementary Table 2 for additional demographic information). Data collection spanned from June 2021 to April 2024. Within the participants in this dataset, 37 also participated in datasets 1 and 3; 69 in dataset 1; and 63 in dataset 3 (Supplementary Table 3).

EMA assessment and procedure

Participants took part in a Neureka ‘science challenge’ called ‘Pattern Wise’, an EMA tool designed to monitor compulsive behaviors over 6 weeks (42 days). During the sign-up process, participants selected a compulsion they wished to track (e.g., checking appliances, cleaning, nail-biting) and specified a morning time window (between 6:00 – 11:30 AM) to receive the first of three daily notifications for rating their compulsive and affective experiences. The second (afternoon) and third (evening) notifications were sent randomly with an average interval of 5 hours between each notification, resulting in a mean lag of 8.08 ± 0.59 hours, when including overnight lags. Participants could respond until the end of each designated time window. Each notification prompted participants to rate their experiences over the past two hours using an 8-point Likert scale across 11 items. The first four items did not pertain to affect and instead focused on the chosen compulsion and so were excluded from analysis. Participants had to rate whether they spent a lot of time, tried to resist, felt an urge to perform, and felt in control over the selected compulsion, with responses ranging from 0 (not true) to 7 (extremely true). Then, they were asked a more general set of affective items: if they have had repetitive, distressing thoughts, experienced stressful events, felt bored, and felt guilty, using the same response scale. Finally, they rated if they felt sad or happy (response scale from 0 [sad] to 7 [happy]), energetic or tired (0 [energetic] to 7 [tired]), and relaxed or anxious (0 [relaxed] to 7 [anxious]). The items were always presented in the same order. While all 11 items were used for the calculation of DQRT (see Digital questionnaire response time calculation section), the first four questions related to compulsions were excluded from the main analysis and are the subject of a separate project on compulsivity. Participants were included in this dataset if they completed at least 50% of the EMA assessments (63 out of a maximum of 126). A total of 15,598 observations were gathered, with a median of 88 assessment sessions per participant (range = 63 – 126). Mean responses in EMA questionnaires can be found in Supplementary Table 4 and data distributions in Supplementary Figure 2.

Dataset 3

Participants

This dataset included 195 citizen scientists (76.4% female) aged between 19 and 82 years (mean age = 54.3 ± 12.1) recruited through the Neureka app from July 2022 to November 2024 (see Supplementary Table 2 for additional demographic information). Among these participants, 37 also participated in datasets 1 and 2; 38 in dataset 1; and 94 in dataset 2 (Supplementary Table 3).

EMA assessment and procedure

Participants took part in ‘Brain Changer’, a ‘science challenge’ within the Neureka app, which involved EMA tracking of depression symptoms and repeated cognitive flexibility assessments over 8 weeks (56 days). At sign-up, participants selected two 3-hour time windows (between 6:00 – 11:30 AM and 6:00 – 11:30 PM) during which they would receive notifications for affect ratings. Notifications were delivered at the start of each time window and approximately every 12 hours (mean lag = 11.98 ± 0.71 hours), allowing participants to respond until the end of the designated time frame. Each notification prompted participants to rate their current affect by clicking or sliding on an 11-point visual analogue scale ranging from 0 (not true at all) to 10 (extremely true). The EMA items were adapted from the Quick Inventory of Depressive Symptomatology, self-report (QIDS-SR-1631), a validated questionnaire to evaluate the Diagnostic and Statistical Manual of Mental Disorders (Fourth Edition, Text Revision, DSM-IV-TR) depression criterion symptom domains. The item on suicidality was not assessed. Fourteen affect-related items were presented in a randomized order during both morning and evening assessments, including the following statements: ‘I can’t concentrate’, ‘I can’t enjoy anything’, ‘I can’t make decisions’, ‘I don’t feel interested in things’, ‘I feel anxious’, ‘I feel guilty’, ‘I feel irritated’, ‘I feel restless’, ‘I feel sad’, ‘I feel slow’, ‘I feel stressed’, ‘I feel tired’, ‘I feel worried’, ‘I feel worthless’. Morning assessments included three additional items (always presented first): ‘I had trouble sleeping’, ‘I slept too much’, and ‘My appetite is’… (rated on a scale from low to high), which were excluded from all analyses.

Every second day, in the evening, participants were asked to play ‘Star Racer’, a gamified version of the Trail Making Test – part B (Trails-B), a well-established measure of cognitive processing speed32. ‘Star Racer’ has been described and validated in a previous work54. In this game, 25 blue stars labelled with both numbers (1 to 13) and letters (A to L) are displayed on the smartphone screen and participants are instructed to tap on them alternating between numbers and letters in ascending order as quickly as possible. To provide feedback, correctly selected stars turn pink and incorrectly selected stars turn light purple and shake, indicating an error. Participants completed four runs featuring randomly generated star locations. The primary outcome of interest was the average time it took for each participant to complete the task across these runs, with higher scores representing slower (i.e., worse) performance.

The criteria to include participants in this dataset were if they completed at least 50% of the EMA assessments (56 out of a maximum of 112 possible assessments). This yielded a total of 16,729 observations, with a median of 86 assessments per participant (range = 56 – 110). Mean responses in EMA questionnaires are summarized in Supplementary Table 4 and data distribution is displayed in Supplementary Figure 3.

Digital questionnaire response time calculation

We followed DQRT calculation guidelines as reported in Teckentrup et al.27. For each participant and each EMA questionnaire (16 items in dataset 1, 11 items in dataset 2, 14 items in dataset 3), we extracted the item-level timestamps and calculated the time difference between them (i.e., item-level response times). For the data used in this work, the Neureka app provided timestamps with a second-level precision. Then, a two-tiered approach was applied to address outliers potentially caused by careless responding or interruptions during assessments. First, we removed single item response times longer than 900 seconds and calculated the sample-specific median response time on this coarsely cleaned data. Second, for each dataset, we removed values greater than the sample specific median DQRT + 2 standard deviations. No lower threshold was used. This criteria were shown to yield the strongest association with cognitive flexibility as measured by Trails-B performance27. The mean DQRT per participant per EMA session was used in further analyses, with higher scores indicating slower responses. Dataset 1 showed a mean DQRT = 2.15 ± 0.67 seconds (range = 0.88 – 5.49). Dataset 2 showed a mean DQRT = 2.62 ± 0.69 seconds (range = 1.45 – 5.25). Dataset 3 showed a mean DQRT = 2.63 ± 0.78 seconds (range = 0.73 – 6.06). The distribution of DQRT values for each dataset is displayed in Supplementary Figure 4a.

Trails-B total score calculation

Only data from participants in dataset 3 that completed at least 50% of Trails-B assessments (14 out of a maximum of 28 possible sessions) were analyzed. This resulted in a total of 3,561 Trails-B observations across 163 participants (122 female), with a median of 22 assessments per participant (range = 14 – 28).

Participants completed four runs of Trails-B. For each separate run, we first extracted the time in seconds taken to complete the map, i.e., correctly selecting all 25 stars in order, alternating between numbers and letters. We excluded runs exceeding 300 seconds. This cut-off reflects double the median completion time for the Trail Making Test – part B (median = 142.5 seconds) measured in the oldest and least educated group in a normative study55. Next, we calculated the mean completion time across the remaining runs per assessment session per participant. This was used in further analyses, with higher scores representing slower responses. Following the guidelines of the standard paper-and-pencil version of the Trail Making Test32, errors were not explicitly scored as they are assumed to contribute to an increased time to complete the task. The mean Trails-B performance across the sample was 36.09 ± 11.81 seconds (range = 16.41 – 79.62). The distribution of Trails-B data can be found in Supplementary Figure 4b.

Data preparation

We added a small amount of random noise, ranging from −0.1 to +0.1, to each EMA time series to allow models to converge when EMA time series showed minimal variance over time53. We detrended each DQRT and Trails-B time series to minimize practice effects and ensure stationarity, a required assumption for multilevel vector autoregression models13. The Kwiatkowski-Phillips-Schmidt-Shin (KPSS)56 showed that only 25.33% of DQRT time series and 46% of Trails-B were stationary, in contrast to 66.33% of EMA time series. Given that the majority of EMA time series were stationary (close to 70%, an accepted threshold)57, we did not detrend them.

Visual inspection suggested that DQRT (Supplementary Figure 4c) and Trails-B (Supplementary Figure 4d) followed a negative exponential pattern, characterized by a rapid initial decrease—indicating practice effects—that gradually stabilized over time. To account for these temporal trends, we estimated a regression model for each participant’s time series, regressing it on a linear term and an exponential term of ‘assessment day’ (i.e., day number since the beginning of the study), raised to the power of −0.2. The use of a negative exponential model was shown to fit the data better than a polynomial model for capturing practice effects in response time-based cognitive measures58. The residuals from this model were added to each participant’s mean score across the entire assessment period, and these detrended time series were then used in further analyses. Post-detrending, KPSS56 tests showed that 100% of DQRT and Trails-B time series were stationary. This confirmed that the detrending process effectively removed temporal trends.

Multilevel vector autoregressive models

We used two-step multilevel vector autoregressive models using the ‘lme4’ package33 (v1.1.28) in R to investigate between-person and within-person contemporaneous partial correlations and temporal associations (standardized beta coefficients) between each EMA item and DQRT. We followed the methodology implemented in the mlVAR package as described in Epskamp, et al13. However, since the package does not support the inclusion of covariates, we did not use the mlVAR() function directly. Instead, we adapted the modeling approach by customizing the formulas to incorporate covariates. In the first step, both variables at a given time point were regressed on the lagged values from the previous assessment of the other variable as well as their lagged values, allowing to estimate cross-lagged and autoregressive effects, respectively. Participant’s means (excluding the mean of the dependent variable) were included as predictors to estimate between-person effects alongside within-person dynamics. Age was entered in the models as years and gender as a contrast-coded factor with levels 1 (female) and −1 (male), and other selections replaced by NA (1.33% of data in dataset 1, 0.57 in dataset 2, and 1.54% in dataset 3). We also performed an exploratory analysis including interaction terms with the lagged variables aiming to test if the directed effect of affect on DQRT was modulated by the average level of affect (EMA item mean), age, and gender. All models included a random intercept to account for individual differences in overall levels of the dependent variable. Random slopes were not included as models failed to converge. Continuous variables were first scaled across the sample and predictors were also within-person centered.

Following validated methods13, between-person partial correlations were obtained by averaging two regression parameters: the parameter that indicates how well the mean of the EMA item predicts the mean of DQRT and the regression parameter denoting how well the mean of DQRT predicts the mean of the EMA item. In a second step, we estimated within-person contemporaneous associations using the residuals of the multilevel models that estimated the temporal and between-person effects. Partial correlations were obtained by averaging two resulting regression parameters, i.e., how well EMA predicts DQRT and how well DQRT predicts EMA at a given time point from the residuals of step 1.

P-values were corrected for multiple comparisons using the FDR method with an alpha level of P < 0.0536. Unlike conservative methods such as familywise error (FWE), which reduce the chance of committing any Type I errors (false positives), FDR allows for a small, manageable number of false positives to reduce the likelihood of missing true effects (false negatives), making it more sensitive and suitable when analyzing large sets of comparisons59. As between-person and within-person contemporaneous associations resulted from the average of two regression parameters, results were considered significant if both PFDR < 0.05 (‘and’ rule)13.

Sensitivity analysis

To address the overlap between samples across datasets (Supplementary Table 3) and ensure that results were not driven by a minority of individuals, all models were re-estimated using unique participants in each dataset. Repeated participants were assigned to the smaller datasets, forming independent samples with N = 609 (426 female) in dataset 1, N = 173 (119 female) in dataset 2, and N = 132 (103 female) in dataset 3. Then, the same methods as described above (DQRT calculation, data preparation, and multilevel vector autoregressive models) were implemented in these non-overlapping samples.

Trails-B association with DQRT and EMA items

Using dataset 3, we first assessed the between-person association between Trails-B performance and DQRT (down-sampled to the occasions of Trails-B assessments) by calculating the Spearman correlation (rho) between participants’ average raw scores for each variable. We also computed Spearman correlations between the raw Trails-B and DQRT scores across the assessment period for each individual. This allowed us to explore the distribution of within-person relationships over time between the two timeseries. To assess the association between Trails-B and DQRT scores while accounting for both between- and within-person variance and controlling for age and gender, we conducted a multilevel mixed-effects model using the ‘lme4’ package33 (v1.1.28). The model included DQRT scores as the dependent variable and both the mean (between- person) and time-varying (within-person) Trails-B scores as predictors. Age was entered in the models as years and gender as a contrast-coded factor with levels 1 (female) and −1 (male), while other selections (1.54% of the data) were replaced by NA. A random intercept was included to account for individual differences in overall DQRT levels, and a random slope for T rails-B was included to allow for individual variability in the relationship between Trails-B and DQRT over time. All data were first scaled across the sample, with predictors also centered within-person. Standardized beta coefficients (P < 0.05) are reported as outcomes of interest.

Second, we compared our results on the association between affect (measured by EMA) and DQRT to Trails-B as a well-established task measuring cognitive processing speed. We modified the analysis pipeline to account for the different structure to this dataset. For each EMA item, we fitted a multilevel mixed-effects model to predict Trails-B performance in the evening (as Trails-B was always assessed PM) from the mean EMA item score (between-person effect), EMA item score in the same time window (i.e., PM, within- person contemporaneous effect), and EMA item score in the morning (i.e., AM, within- person temporal effect). Age (years) and gender (contrast factor with levels 1 [female] and −1 [male]) were included as covariates. A random intercept for Trails-B was included to account for individual variability in overall DQRT levels. Continuous data were scaled across the sample and predictors were centered within-person. Standardized beta coefficients for each association are reported as outcomes of interest. Given that these analyses were exploratory and included a limited number of observations, we report both FDR-corrected and uncorrected P-values, with the significance threshold set to 0.05. To make a direct comparison to the DQRT results, we down-sampled DQRT data, fixing it to Trails B assessments and repeated the analysis above. We assessed internal consistency of Trails-B and DQRT using the ICC. For this purpose, we used a two-way mixed-effects model with single raters and absolute agreement specifications34.

Data availability

The data used in this study are available upon completion of a data access request and data sharing agreement available at the Open Science Framework: https://osf.io/5re67/. Part of dataset 1 includes previously published data53, available at https://osf.io/wz6rn/.

Code availability

All scripts used for main data analysis and the creation of figures are available at the Open Science Framework: https://osf.io/5re67/.

Supplementary information

Previous EMA studies using EMA to investigate within-person relationships between affect and cognition

Participants’ demographics

Unique and overlapped participants across datasets

Mean responses in EMA questionnaires

Between-person effects

Within-person contemporaneous effects

Effects on DQRT at time t

Effects on mood at time t

EMA associations with Trails-B PM performance

EMA associations with DQRT PM (Trails-B days)

EMA data distribution in dataset 1

The histograms show the distribution of EMA responses across all participants for each item included in the analysis. The x-axis represents the possible response values in the rating scale, and the y-axis represents the frequency of observations. Analyses were performed on a sample of 753 participants with a total of 65.541 observations (median = 90, range = 56 - 112). EMA: ecological momentary assessment.

EMA data distribution in dataset 2

The histograms show the distribution of EMA responses across all participants for each item included in the analysis. The x-axis represents the possible response values in the rating scale, and the y-axis represents the frequency of observations. Analyses were performed on a sample of 173 participants with a total of 15.598 observations (median = 88, range = 63 - 126). EMA: ecological momentary assessment, Rep. thought: repetitive thought.

EMA data distribution in dataset 3

The histograms show the distribution of EMA responses across all participants for each item included in the analysis. The x-axis represents the possible response values in the rating scale, and the y-axis represents the frequency of observations. Analyses were performed on a sample of 195 participants with a total of 16.729 observations (median = 86, range = 56 - 110). Can’t conc.: can’t concentrate, EMA: ecological momentary assessment, No interest: no interested.

DQRT and Trails-B data

The histograms show the distribution of (a) DQRT and (b) Trails-B across all participants. The x-axis represents seconds, and the y-axis represents the frequency of observations. The bottom panel shows (c) the mean DQRT for each dataset and (d) the mean Trails-B performance for dataset 3 across participants, plotted against the days or number of assessments. Horizontal dashed lines represent the overall sample mean across the assessment period, for both the original (grey) and detrended (colored) time series. The original DQRT and Trails-B time series (grey solid lines) showed a tendency to decrease over time, indicating faster responses (i.e., practice effects). After applying the detrending procedure (see Methods in main text for details), all the time series across datasets became stationary (colored solid lines), as prerequisite for multilevel vector autoregressive models. Dataset 1 included 753 participants with a total of 65.541 observations (median = 90, range = 56 - 112). Dataset 2 included 173 participants with a total of 15.598 observations (median = 88, range = 63 - 126). Dataset 3 included 195 participants with a total of 16.729 observations (median = 86, range = 56 - 110). For Trails-B analyses, we used a subsample of 163 participants from dataset 3, with a total of 3.561 observations (median = 22, range = 14 - 28). DQRT: digital questionnaire response time.

Main results using non-overlapping samples

This figure presents (a) between- and within-person contemporaneous and (b, c) temporal associations between EMA and DQRT including only unique (i.e., non-overlapping) participants across datasets. To rule out the possibility that our results were driven by a minority of participants, those who contributed to more than one dataset (Supplementary Table 2) were assigned to the smaller dataset and models were re-estimated. This allocation resulted in three independent samples. Dataset 1 retained 609 out of 753 total participants (426 female), with 53.328 total observations (median observations per participant = 91, range = 56-112). Dataset 3 retained 132 out of 195 total participants (103 female), with 11.106 total observations (median observations per participant = 84, range = 56-110). Dataset 2 comprised the same participants as reported in the main text (N = 173, 119 female) and is therefore not reproduced here. This sampling approach avoided overlap and ensured the independence of results across datasets. Can’t conc.: can’t concentrate, CI: confidence interval, EMA: ecological momentary assessment, DQRT: digital questionnaire response time, FDR: false discovery rate, No interest.: no interested, Non-sig.: non-significant, Rep. thought: repetitive thought.

Acknowledgements

This work was funded by an ERC starting grant [ERC-H2020-HABIT] and a project grant from a Science Foundation Ireland [19/FFP/6418] awarded to CMG. SF is an Atlantic Fellow for Equity in Brain Health at the Global Brain Health Institute (GBHI) and is supported with funding from GBHI, Alzheimer’s Association, and Alzheimer’s Society [GBHI ALZ UK-24-1068607], and The Irish Longitudinal Study on Ageing (TILDA). VT is supported by an Irish Research Council Postdoctoral Fellowship award [GOIPD/2023/1238]. JRK is principal investigator (Ireland) on COMPASS, GH and Transcend Therapeutics sponsored clinical trials in Dublin, Ireland. JRK has consulted for Clerkenwell Health and has received grant funding from the Health Research Board (ILP-POR-2022-030, DIFA-2023-005, HRB KTA-2024-002). We would like to acknowledge funding from the HSC Research & Development Division, Public Health Agency to support the All Island programme of research on loneliness and social isolation.

Additional information

Author contributions

Conceptualization: SF, VT, CMG; Methodology: SF, VT, CMG; Formal analysis: SF, VT; Investigation: SF, VT, SWK, CAF, AJF, CMG; Resources: VT, SWK, CAF, JK, AMR, AJF, ROS, GL, BL, CMG; Data Curation: SF, VT, SWK; Writing – Original Draft: SF, VT, CMG; Writing – Review & Editing: All authors; Visualization: SF, VT, CMG; Supervision: ROS, BL, CMG; Project administration: SF, VT, CMG; Funding acquisition: ROS, GL, BL, CMG.