# Data Analysis

## 3.4. Data Analysis

All analyses were conducted using Python (version 3.13.3; Python
Software Foundation, 2025) on macOS Sonoma (version 14.4.1). The
following open-source packages were used: pandas (version 2.1.2) for
data structures and data manipulation (McKinney, 2010), NumPy (version
1.26.1) for numerical operations (Harris et al., 2020), Pingouin
(version 0.5.5) for correlation analysis (Vallat, 2018), scikit-learn
(version 1.3.2) for standardisation of continuous variables (Pedregosa
et al., 2011), and Statsmodels (version 0.14.0) for linear and
hierarchical regression modelling (Seabold & Perktold, 2010).
Visualisations were created using Matplotlib (version 3.8.1; Hunter, 2007) and Seaborn (0.13.0; Waskom, 2021).

All participants (_N_ = 258) completed every measure in full. No missing
data imputation or listwise deletion was necessary. Logarithmic values
for participants’ age and number of books read were used in correlation
and regression analyses. Correlational analyses were conducted using
Pearson’s _r_, and hierarchical regression models were built to examine
the effects of demographic and psychological variables on empathy and
mentalisation. Hierarchical multiple regression analyses were conducted
using ordinary least squares (OLS) estimation with classical
(non-robust) standard errors. Variables were entered in three blocks:
demographic control variables, primary predictors, and interaction
terms. Categorical variables in the control block were dummy-coded using
reference categories. Predictors involved in interaction terms were
mean-centred prior to computing product terms. Standardised beta
coefficients (β) were calculated by multiplying each unstandardised
coefficient by the ratio of the standard deviation of the predictor to
that of the outcome (i.e., _β_ = _B_ × *SD*ₓ / *SD*ᵧ). Model
assumptions, including normality of residuals, homoscedasticity,
multicollinearity (VIF), and influence (Cook’s distance), were checked
and met. Results were reported in accordance with APA 7 guidelines
(American Psychological Association, 2020), with unstandardised
coefficients (_B_), standard errors (SE), standardised beta (_β_),
_t_-values, _p_-values, and model statistics (*ΔR*², *R*²,
_F_<sub>change</sub>, _p_<sub>change</sub> and total model _F_) for each
step. An alpha level of .05 was used for significance testing in
regression analyses, while both .05 and .001 thresholds were considered
when interpreting correlation results.

All materials, including the dataset, analysis scripts, and survey
preview, are available in an OSF repository (see Appendix L).