Response and explanatory variables
Get the roles right with response and explanatory variables in Year 12 VCE General Mathematics. Do hotter days bring more people to the beaches of Port Phillip Bay? Before drawing any graph, you need to decide which variable might explain the other, because that choice shapes every display and calculation that follows.
You will learn to read the aim of a study and pick the explanatory variable, name the response, and decide whether each is numerical or categorical. You will put them on the correct axes of a scatterplot, set up two-way tables with the explanatory variable in the columns, and spot the explanatory variable in an experiment, ready for describing associations between categorical variables.
Theory
Every investigation of an association has an explanatory variable and a response variable. This Year 12 General Mathematics guide for students in Victoria shows how to tell them apart from the aim of the investigation, place them on the axes of a scatterplot or in the columns of a two-way table, and recognise them in an experiment.
When we look for an association between two variables, we usually expect one of them to help explain the other. The explanatory variable is the one that may explain, influence or be used to predict the other. The response variable is the outcome: the variable whose values we expect to change in response.
Both kinds of variable can be numerical (measured or counted, such as temperature in °C) or categorical (groups, such as petrol or hybrid). For two numerical variables, the explanatory variable goes on the horizontal axis of a scatterplot and the response on the vertical axis. In a two-way frequency table, the categories of the explanatory variable label the columns, and percentages are found within each column. A categorical explanatory variable with a numerical response is compared with parallel boxplots, one for each category.
The roles come from the question being asked. In an experiment, the variable that the researcher sets or changes is the explanatory variable, and what is measured as a result is the response.
Type of car (categorical, explanatory) and fuel consumption (numerical, response): one boxplot for each type of car.
There is no calculation in this idea, only a set of conventions for setting out the data. For two numerical variables, each individual is one ordered pair:
For two categorical variables, with the explanatory variable in the columns, each percentage is taken within its column:
How to decide which variable is explanatory
- Read the aim of the investigation: what is being explained or predicted?
- Choose the explanatory variable: the one that may explain or be used to predict the other. In an experiment it is the variable that is set or changed.
- Name the response variable: the outcome that is measured or predicted.
- Decide the type of each variable: numerical or categorical.
- Set out the data: explanatory on the horizontal axis of a scatterplot (points written as (explanatory, response)), or explanatory in the columns of a two-way table with percentages found within each column.
Ask which variable may explain changes in the other.
| \(\text{sunshine may affect sugar}\) | \(\Rightarrow\) | \(\text{explanatory: sunshine}\) |
| \(\text{sugar level is the outcome}\) | \(\Rightarrow\) | \(\text{response: sugar level}\) |
| \(\text{both are measured}\) | \(\Rightarrow\) | \(\text{both numerical}\) |
(a) Hours of sunshine. (b) Sugar level. (c) Both are numerical. Sugar levels cannot change the weather, so the roles cannot be the other way round.
The variable used to predict is explanatory; the one being predicted is the response.
| \(\text{predict reach from height}\) | \(\Rightarrow\) | \(\text{explanatory: height}\) |
| \(\text{predict height from reach}\) | \(\Rightarrow\) | \(\text{explanatory: reach}\) |
(a) Height. (b) Yes: the roles swap, because the question has changed. Neither variable causes the other; the roles come from what is being predicted.
More training may lower the resting pulse, so training sessions is explanatory and goes across.
| \(\text{training may explain pulse}\) | \(\Rightarrow\) | \(\text{response: pulse}\) |
| \(x = 4\) | \(\Rightarrow\) | \(y = 38\) |
| \((x,\ y)\) | \(=\) | \((4,\ 38)\) |
(a) The resting pulse. (b) 38 beats in \(30\) seconds. (c) \((4,\ 38)\).
| Where the rider lives | ||
|---|---|---|
| Town | Farm | |
| Wears a helmet | \(171\) | \(72\) |
| No helmet | \(9\) | \(48\) |
| Total | \(180\) | \(120\) |
Where a rider lives may explain helmet use, so find percentages within each column.
| \(\text{where they live may explain helmet use}\) | \(\Rightarrow\) | \(\text{explanatory}\) |
| \(\text{Town}\) | \(=\) | \(\dfrac{171}{180}\times 100\%\) |
| \(\) | \(=\) | \(95\%\) |
| \(\text{Farm}\) | \(=\) | \(\dfrac{72}{120}\times 100\%\) |
| \(\) | \(=\) | \(60\%\) |
(a) Where the rider lives; its categories (Town, Farm) label the columns. (b) 95% of town riders and 60% of farm riders wear a helmet. Dividing by the column totals lets the two groups be compared fairly, even though they are different sizes.
Common pitfalls
Frequently asked questions
What is the difference between explanatory and response variables?
The explanatory variable is the one that may explain or predict changes in the other. The response variable is the outcome that may change as a result. For temperature and beach visitors, temperature is explanatory and the number of visitors is the response.
Which variable goes on the x-axis of a scatterplot?
The explanatory variable goes on the horizontal x-axis and the response variable goes on the vertical y-axis.
Where does the explanatory variable go in a two-way table?
Put the categories of the explanatory variable across the top as the column headings, then find the percentages within each column by dividing by the column total.
Can a categorical variable be an explanatory variable?
Yes. For example, type of car (petrol or hybrid) can explain fuel consumption. With a numerical response like this, the groups are compared with parallel boxplots, dot plots or a back-to-back stem plot.
Can the explanatory and response variables swap?
Yes. The roles depend on the question. If you predict reach from height, height is explanatory; if you predict height from reach, reach is explanatory.
Does the explanatory variable cause the response?
Not necessarily. It may explain the response, but an association in data does not prove cause and effect. A well-designed experiment is needed for that.