Confounding Variable vs Explanatory Variable
Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.
Confounding variable
Collecting data and study design
A confounding variable is associated with both the explanatory variable and the response, so its effect and the explanatory variable's cannot be told apart.
Confounding is a two-part test and a variable has to pass both parts. The candidate must be associated with the explanatory variable, so the groups being compared differ on it, and it must also be associated with the response. Fail either part and the variable is not a confounder.
A district finds that students who eat the free school breakfast score higher on a reading test than students who do not. Explanatory variable: eats the school breakfast. Response: reading score. Family income passes both parts, since lower-income families take up a free breakfast at higher rates and income is separately related to reading scores, so the breakfast gap and the income gap are the same gap seen twice. Nothing in these data says which one moved the score.
Now a variable that fails. Suppose 12 percent of the breakfast eaters are left-handed and 12 percent of the non-eaters are as well. Handedness is spread evenly across the two groups, so it is not associated with the explanatory variable, and whatever it does to reading it cannot account for a difference between them. That is the correction worth keeping, because the wrong version is everywhere: "any variable that could affect the reading score is a confounding variable." No. A variable that affects the response but has no tie to who ate breakfast is an extraneous variable. It adds spread to the scores rather than a lean to the comparison.
The other half of the test fails just as often. Riding the school bus is strongly associated with eating the school breakfast, because bus riders arrive early, but if riders and walkers read alike then bus riding explains none of the gap.
Confounding is a feature of how a study was built, not something you can spot in the numbers. Random assignment attacks the first link by making the treatment groups similar on average on every other variable, measured or not, though in a small experiment chance can still leave a group tilted. Topic 1.13 Experimental Design is where this sits.
Explanatory variable
Variables and data types
An explanatory variable is the one whose values are used to explain or predict the response variable; it goes on the x-axis of a scatterplot.
The explanatory variable is the one whose values you use to explain or predict the other. It is also called the independent variable or the predictor, and in an experiment it is the factor whose levels define the treatments. It supplies the values, sits on the horizontal axis, and is the variable a regression conditions on. The label names a role you assign, not a property the variable carries around: the same measurement can be explanatory in one study and the response in another.
Four people sleep 5, 6, 7 and 8 hours and post reaction times of 320, 300, 290 and 270 milliseconds. Treat sleep as explanatory and the least-squares slope is milliseconds per extra hour. Now ask the reverse question, predicting sleep from reaction time, and the slope is about hours per millisecond, which is not . Swapping the roles fits a different line to the identical four points, so the choice is doing real work.
The wrong sentence is "sleep is the explanatory variable, so sleep causes the faster reactions." Calling a variable explanatory records which question you are asking. It is a claim about the analysis, not about the world. Those four people chose their own bedtimes, so anything travelling with sleep, such as age, caffeine or shift work, explains the same pattern equally well; see confounding variable.
Causal language becomes available when the researcher sets the explanatory variable and assigns its values at random, because random assignment is what makes the groups comparable on everything else. That is an experiment, topic 1.13. It also means the explanatory variable is often categorical rather than numerical: which of three fertilizers a plot received is an explanatory variable with no scale at all, and the comparison is between group means rather than along a line.
Scatterplots of two quantitative variables put the explanatory variable on the horizontal axis, topic 5.1. For the two roles set out side by side, see explanatory vs response variable.