Performing a statistical interaction
We tested a potential moderator using the gapminder data. we asked the question " Does the relationship between income per person and life expectancy depend on urban rate?". To do this, we used the following syntax:
Results obtained
Association between income and life expectancy for low urban rate countries
Association between income and life expectancy for medium urban rate countries
Association between income and life expectancy for high urban rate countries
Interpretation of the results
When we look at the relationship between income per person and life expectancy across countries grouped by urbanization level:
High Urban Rate Countries (n = 59) show a strong positive correlation (r = 0.695, p < 0.00000001). This means that in highly urbanized countries, higher income is strongly associated with longer life expectancy.
Medium Urban Rate Countries (n = 58) have a moderate positive correlation (r = 0.496, p < 0.0001). Here, income still matters for life expectancy, but the effect is smaller than in high urbanized countries.
Low Urban Rate Countries (n = 59) show a weaker positive correlation (r = 0.412, p = 0.0012). In countries with low urbanization, income is positively related to life expectancy, but the association is the weakest among the three groups.











