If you’re seeing this message, it means we’re having trouble loading external resources on our website.

If you’re behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Answer: A variable is an object, event, idea, feeling, time period, or any other type of category you are trying to measure. There are two types of variables-independent and dependent.

Question: What’s an independent variable?

Answer: An independent variable is exactly what it sounds like. It is a variable that stands alone and isn’t changed by the other variables you are trying to measure. For example, someone’s age might be an independent variable. Other factors (such as what they eat, how much they go to school, how much television they watch) aren’t going to change a person’s age. In fact, when you are looking for some kind of relationship between variables you are trying to see if the independent variable causes some kind of change in the other variables, or dependent variables.

Question: What’s a dependent variable?

Answer: Just like an independent variable, a dependent variable is exactly what it sounds like. It is something that depends on other factors. For example, a test score could be a dependent variable because it could change depending on several factors such as how much you studied, how much sleep you got the night before you took the test, or even how hungry you were when you took it. Usually when you are looking for a relationship between two things you are trying to find out what makes the dependent variable change the way it does.

Many people have trouble remembering which is the independent variable and which is the dependent variable. An easy way to remember is to insert the names of the two variables you are using in this sentence in they way that makes the most sense. Then you can figure out which is the independent variable and which is the dependent variable:

(Independent variable) causes a change in (Dependent Variable) and it isn’t possible that (Dependent Variable) could cause a change in (Independent Variable).

For example:

(Time Spent Studying) causes a change in (Test Score) and it isn’t possible that (Test Score) could cause a change in (Time Spent Studying).

We see that “Time Spent Studying” must be the independent variable and “Test Score” must be the dependent variable because the sentence doesn’t make sense the other way around.

For example, if you are interested in the effect of a diet on health, you can use multiple measures of health: blood sugar, blood pressure, weight, pulse, and many more. Each of these is its own dependent variable with its own research question.

You could also choose to look at the effect of exercise levels as well as diet, or even the additional effect of the two combined. Each of these is a separate independent variable.

To ensure the internal validity of an experiment, you should only change one independent variable at a time.

In an experiment, there are two types of variables:

The independent variable: The variable that an experimenter changes or controls so that they can observe the effects on the dependent variable.

The dependent variable: The variable being measured in an experiment that is “dependent” on the independent variable.

In an experiment, a researcher wants to understand how changes in an independent variable affect a dependent variable.

When an independent variable has multiple experimental conditions, we say that there are levels of the independent variable.

For example, suppose a teacher wants to know how three different studying techniques affect exam scores. She randomly assigns 30 students each to use one of the three studying techniques for a week, then each student takes the exact same exam.

In this example, the independent variable is Studying Technique and it has three levels:

- Technique 1
- Technique 2
- Technique 3

In other words, there are the three experimental conditions that the students can potentially be exposed to.

The dependent variable in this example is Exam Score, which is “dependent” on the studying technique used by the student.

The following examples illustrate a few more experiments that use independent variables with multiple levels.

### Example 1: Advertising Spend

Suppose a marketer conducts an experiment in which he spends three different amounts of money (low, medium, high) on TV advertising to see how it affects the sales of a certain product.

In this experiment, we have the following variables:

Independent Variable: Advertising Spend

Dependent Variable: Total sales of the product

### Example 2: Placebo vs. Medication

Suppose a doctor wants to know if a certain medication reduces blood pressure in patients. He recruits a simple random sample of 100 patients and randomly assigns 50 to use a pill that contains the real medication and 50 to use a pill that is actually just a placebo.

In this experiment, we have the following variables:

Independent Variable: Type of Medication

- 2 Levels:
- True medication pill
- Placebo pill

Dependent Variable: Overall change in blood pressure

### Example 3: Plant Growth

Suppose a botanist uses five different fertilizers (We’ll call them A, B, C, D, E) in a field to determine if they have different effects on plant growth.

In this experiment, we have the following variables:

Independent Variable: Type of fertilizer

- 5 Levels:
- Fertilizer A
- Fertilizer B
- Fertilizer C
- Fertilizer D
- Fertilizer E

Dependent Variable: Plant growth

### How to Analyze Levels of an Independent Variable

Typically we use a one-way ANOVA to determine if the levels of an independent variable cause different outcomes in a dependent variable.

A one-way ANOVA uses the following null and alternative hypotheses:

- H0 (null): All group means are equal
- H1 (alternative): At least one group mean is different from the rest

For example, we could use a one-way ANOVA to determine if the five different types of fertilizer in the previous example lead to different mean growth rates for the plants.

If the p-value of the ANOVA is less than some significance level (e.g. α = .05), then we can reject the null hypothesis. This means we have sufficient evidence to say that the mean plant growth is not equal at all five levels of the fertilizer.

We could then proceed to conduct post-hoc tests to determine exactly which fertilizers lead to different mean growth rates.

### Can there be 2 independent variables?

Researchers often include multiple independent variables in their experiments. The most common approach is the factorial design, in which each level of one independent variable is combined with each level of the others to create all possible conditions.

### How many independent variables are there in a 2 by 2 design?

Thus, in a 2 X 2 factorial design, there are four independent groups and participants are randomly assigned to one of the four groups.

### What is an independent variable with 2 levels?

Levels of an Independent Variable

If an experiment compares an experimental treatment with a control treatment, then the independent variable (type of treatment) has two levels: experimental and control.

### How many independent variable are there?

There are two main types of independent variables. Experimental independent variables can be directly manipulated by researchers.