## 3 Results  
The primary objective of this study was to understand whether the improvement in cognitive performance was a fundamental step in the therapeutic process of TMS. Therefore, we measured cognitive and clinical symptom variables before starting the treatment and at the end of the \"intensive\" period across three different pathologies and three different stimulation protocols (Figure 1). Obtaining a synthetic index of such a diverse set of cognitive assessment data can be problematic, so we decided to use a custom data-driven approach based on PCA. The scree plot of the PCA results applied to the data obtained during the first visit indicates that two components sufficiently describe the dataset. In fact, these two axes explain more than 50% of the variance. The biplot of these two principal components shows that variables related to clinical symptoms (all SCL-90 subscales) align along the first axis (PC1), whereas those related to demographic (education) and cognitive measures (SPM, verbal fluency, forward and backward digit span) align along the second axis (PC2) (Figure 2). To observe the effect of the TMS protocols on these two axes, we applied the same loadings of the two principal components to the same variables measured after the \"intensive\" period. Thus, we obtained a full set of pre- and post-treatment data in terms of PC1 and PC2 components. To determine whether the treatment, diagnosis, or an interaction between these two variables caused alterations in the two axes, two different LMEs (one for each principal component) were fitted to these data using the following formula (Wilkinson notation):  
\[Y\sim 1+TMS+Diagnosis+TMS\cdot Diagnosis+(1\,subject)\]  
where Y is PC1 or PC2. Among the fixed effects, TMS is a dichotomous pre/post treatment variable, Diagnosis is the categorical variable of the three treated pathologies (i.e., SUD, MDD, and OCD), and TMS \(\cdot Diagnosis\) is the interaction of the two. Finally, a random effect of the subject was included. In the first LME (i.e., where Y = PC1), the TMS variable was the only significant factor (\(\chi^{2}\) = 13.5034, \(p\) < 0.001, Figure 3a), while in the second LME (i.e., where Y = PC2), only the Diagnosis variable was significant (\(\chi^{2}\) = 7.3725, \(p\) = 0.025, Figure 3b). These analyses, therefore, support the effectiveness of TMS treatment on clinical symptoms but refute the original hypothesis that this improvement was preceded by cognitive enhancement. Indeed, PC2 does not change after the treatment. Since DD represents a transdiagnostic factor belonging to the hot psychological domains [15], to determine whether there were effects related to diagnosis or treatment, two additional linear mixed-effects models were performed as follows (specifically considering the devaluation coefficient k, as performed in other studies [33]): one for low rewards, i.e., DD Low, and the other for high rewards, i.e., DD High. This was carried out using the following formula (Wilkinson notation):  
\[Y\sim 1+TMS+Diagnosis+TMS\cdot Diagnosis+(1\,subject)\]  
where Y is DD Low and DD High. Among the fixed effects, TMS is a dichotomous pre/post treatment variable, Diagnosis is the categorical variable of the three treated pathologies(SUD, MDD, and OCD), and TMS \(\cdot\) Diagnosis is the interaction of the two. Finally, a random effect of the subject was included. However, no variable was significant, indicating that DD is not modified by any of the TMS protocols (Figure 4). Figure 2: **Biplot of the first two principal components. ** The arrows represent how much each experimental variable influences the two axes (SPM: Raven’s matrices; DD_Low: the fitting k of the DD curve for low rewards; DD_High: the fitting k of the DD curve for high rewards). Figure 3: **Effect of TMS on the two principal components. ****(a)** The boxplot shows the values of the subjects’ first component (PC1) before (PRE) and after (POST) TMS treatment (Chi-sq1: 13.5034, \(p\) < 0.001).