Definition of groups with a numerical variable

The earlier pages of this section explained how to take account of an additional categorical variable, Z, when analysing the relationship between two numerical variables, X and Y. In this page, we describe a simple way to use a numerical variable, Z, in the same way. (More advanced methods are better but this simple method is easier to understand graphically.)

By grouping Z into classes (e.g. under 100 and over 100), it is possible to treat it as a categorical variable and examine the relationship between Y and X for each of the resulting groups of individuals.

Body fat of AIS athletes

Select Separate lines from the pop-up menu to split the athletes into different height groups (under 175 cm, 175-185 cm and over 185 cm). A separate least squares line is fitted and displayed for short, medium and tall athletes.

This analysis is flawed since it takes no account of the differences between male and female athletes that we saw earlier, but it does indicate one way to model the effect of an auxiliary numerical explanatory variable.

A full analysis of the data should take account of both height and sex but is beyond the scope of an introductory e-book.