Statistical methods
Cluster analysis was performed in order to construct groups or clusters ensuring that within a group the observations are as similar as possible, while observations belonging to different groups are as different as possible, based on four lifestyle variables: healthy diet, step counts, sleep time, and leisure screen time. Z-scores were calculated to standardize the variables and prevent some from having more weight than others in the final solution [Statistical differences were identified by chi-square test for categorical variables and by analysis of variance (one-way ANOVA) for continuous variables and Bonferroni correction was used to adjust for multiple pairwise comparisons. Linear mixed-effect models were used to assess the association between lifestyle clustering and anthropometric indicators. Fixed effects were fasting status (yes/no), maturation stage (continuous, scale 1 to 5/unknow), migrant background (yes/no/unknow), and parental educational level (low/average/high/unknow). Region (Madrid or Barcelona) and schools were handled as random effects.The associations between lifestyle patterns and overweight/obesity (z-BMI percentile ≥ 85Statistical significance was set at a threshold of p < 0.05. Dietary and lifestyle patterns derived by principal component analysis and cluster analysis, respectively, as well as the descriptive statistics, were carried out with SPSS Statistics version 23.0 (Armonk, NY: IBM Corp). Generalized mixed models were carried out using Stata version 15 (StataCorp, College Station, Texas).