this total effect was weakly mediated through the feeling of loneliness, with a non-statistically significant indirect effect equal to 1.012 (HR scale; 95%CI 0.986 to 1.053). This expresses that the hazard of dementia would become 1.012 times higher if all patients were to have limited hearing ability but the loneliness levels were switched from the values that would have been observed if they had normal hearing ability to the value observed under limited hearing. In contrast, the total effect of hearing loss on mortality was not statistically significant (Model 1, HR = 0.882; 95%CI 0.625 to 1.148). There was no statistical evidence of an indirect effect through the feeling of loneliness (HR = 1.001, 95%CI 0.987 to 1.011). These findings did not change when considering model (2) with interaction (table 4 - p-value of the interaction coefficient equals 0.520 for dementia and 0.632 for death).

Figure 3 provides the estimated cumulative incidence curve of dementia for different $a$ and $a^*$, which visualizes the weak indirect effect of hearing loss on dementia through the suggested longitudinal mediator. At some time points, there are large jumps in these curves due to the fairly high rate of interval censoring in the dataset (i.e. 