Title: Two Continuous Variables: An Example
Course: UGQuants (SSPS) > Section: Data Visualisation

Two Continuous Variables: An Example

The scatter plot below shows the relationship between the number of hospital beds per 1000 people in a country and female life-expectancy in years.  In this case, it seems reasonable that health care provision would explain life-expectancy rather than the other way round.  Hospital beds are therefore placed on the x-axis of the scatter plot.

Figure 16: female life expectancy by number of hospital beds per 1,000 people in country

Source: WDI 2011.

In this case, it is not easy to identify the (slightly positive) relationship between the two variables.  This is not uncommon, as relationships in the real world are often much weaker than the examples discussed above.  Many statistical packages will allow you to add a line of best fit to a scatter plot.  This line is a visual representation of the regression equation relating the two variables (including this is often accompanied by an r-squared value). Including these can help to better highlight any relationship present within the data.

Figure 17: female life expectancy by number of hospital beds per 1,000 people in country

Source: WDI 2011.

Scatterplots can also prove useful for identifying unusual cases, for instance, in the graph below Swaziland is highlighted as the case which is furthest away from the line of best fit.  A legitimate line of enquiry would therefore be to conduct further detailed analysis of this case to ask why it deviates from the general pattern In this case, it is certainly not an extreme outlier and we will therefore likely come to the conclusion that it does not affect our model strongly and lies within an acceptable range of variance.

Figure 18: female life expectancy by number of hospital beds per 1,000 people in country

Source: WDI 2011.

However, if we instead of looking at a single point aimed to identify several different ‘clouds’ of points, we would be more successful: most countries in Sub-Saharan Africa  (something we might use as one line of exploration, since that’s where Swaziland lies) cluster around and below 60 years of female life expectancy, forming a cloud of their own, while other countries with the same amount of hospital beds per 1,000 people have a higher female life expectancy at birth.

Figure 19: female life expectancy by number of hospital beds per 1,000 people in country by region

Source: WDI 2011.