# How do you "control" for a factor/variable?

To my understanding, "Control" can have two meanings in statistics.

1. Control group: In an experiment, no treatment is given to the member of the control group. Ex: Placebo vs Drug: You give drugs to one group and not to the other (control), which is also referred as "controlled experiment".

2. Control for a variable: Technique of separating out the effect of a particular independent variable. Some of the other names given to this techniques are, " accounting for", "holding constant", "controlling for", some variable. For example: In a Football viewing study (like or not like), you may want to take out the effect of gender as we think gender causes bias, that is, male may like it more than female.

So, my question is for point (2). Two questions:

How do you "control"/ "account for" variables, in general. What techniques are used? (In terms of regression, ANOVA framework).

In above example, does choosing male and female randomly constitutes control? That is, is "randomness" one of the techniques for controlling other effects?

• In terms of regression and ANOVA, controlling for a variable usually means that variable was included in the model.
– Glen
Commented Dec 6, 2013 at 22:49
• As Glen says, including it in the model is the way to go. However randomization is used to prevent bias from effects not included in the model. Once a design is generated often people counterbalance to make sure of things like about the same number of each gender in each treatment. The problem with relying exclusively on randomization and counterbalance is that they convert that bias into variance and hence it is harder to observe which of your factors are active. Commented Dec 7, 2013 at 9:32

As already said, controlling usually means including a variable in a regression (as pointed out by @EMS, this doesn't guarantee any success in achieving this, he links to this). There exist already some highly voted questions and answers on this topic, such as:

The accepted answers on these questions are all very good treatments of the question you are asking within an observational (I would say correlational) framework, more such questions can be found here.

However, you are asking your question specifically within an experimental or ANOVA framework, some more thoughts on this topic can be given.

Within an experimental framework you control for a variable by randomizing individuals (or other units of observation) on the different experimental conditions. The underlying assumption is that as a consequence the only difference between the conditions is the experimental treatment. When correctly randomizing (i.e., each individual has the same chance to be in each condition) this is a reasonable assumption. Furthermore, only randomization allows you to draw causal inferences from your observation as this is the only way to make sure that not other factors are responsible for your results.

However, it can also be necessary to control for variables within an experimental framework, namely when there is another known factor that also affects that dependent variable. To enhance statistical power and can then be a good idea to control for this variable. The usual statistical procedure used for this is analysis of covariance (ANCOVA), which basically also just adds the variable to the model.

Now comes the crux: For ANCOVA to be reasonable, it is absolutely crucial that the assignment to the groups is random and that the covariate for which it is controlled is not correlated with the grouping variable.
This is unfortunately often ignored leading to uninterpretable results. A really readable introduction to this exact issue (i.e., when to use ANCOVA or not) is given by Miller & Chapman (2001):

Despite numerous technical treatments in many venues, analysis of covariance (ANCOVA) remains a widely misused approach to dealing with substantive group differences on potential covariates, particularly in psychopathology research. Published articles reach unfounded conclusions, and some statistics texts neglect the issue. The problem with ANCOVA in such cases is reviewed. In many cases, there is no means of achieving the superficially appealing goal of "correcting" or "controlling for" real group differences on a potential covariate. In hopes of curtailing misuse of ANCOVA and promoting appropriate use, a nontechnical discussion is provided, emphasizing a substantive confound rarely articulated in textbooks and other general presentations, to complement the mathematical critiques already available. Some alternatives are discussed for contexts in which ANCOVA is inappropriate or questionable.

Miller, G. A., & Chapman, J. P. (2001). Misunderstanding analysis of covariance. Journal of Abnormal Psychology, 110(1), 40–48. doi:10.1037/0021-843X.110.1.40

• Just to emphasize the point on this question (which is re-asked very often), it's good to consider that simply including a variable in a model is not guaranteed to "control" for its effect, even under extremely strong assumptions about the variable being monotonically related to the dependent variable. See the article that is linked in my other comment.
– ely
Commented Dec 17, 2013 at 18:29
• @EMS Good point. I added a cautionary note and your link to the beginning of the text. Feel free to edit my text if you feel there is more to add. Commented Dec 17, 2013 at 18:35

To control for a variable, one can equalize two groups on a relevant trait and then compare the difference on the issue you're researching. I can only explain this with an example, not formally, B-school is years in the past, so there.

If you would say:

Brazil is richer than Switzerland because Brasil has a national income of 3524 billion \$ and Switzerland just 551 billion

you would be correct in absolute terms, but anyone over 12 with a passing knowledge about the world would suspect that there's something wrong with that statement, too.

It would be better to elevate Switzerlands population to that of Brasil and then compare income again. So, if Switzerlands population was the size of Brazils their income would be:

(210 million / 8,5 million) * 551 billion dollars = 13612 billion dollars

This makes them about 4 times as rich as Brazil with 3524 billion dollars.

And yes, you can also take the per capita approach, where you compare average incomes. But the above approach, you can apply that several times.

• You seem to be describing some form of normalization rather than "control" in the sense that is meant in the question.
– whuber
Commented Apr 5, 2019 at 16:37
• Actually, I think those are the same. If you don't think so, feel free to elaborate on the difference between the two Commented Apr 5, 2019 at 17:01