Independent vs Dependent Variables, with Examples
The independent variable is what a researcher changes or compares. The dependent variable is what the researcher measures to see the effect. In a study on whether caffeine affects reaction time, caffeine dose is independent and reaction time is dependent. A quick way to tell them apart is to fill in this sentence: "The effect of [independent variable] on [dependent variable]." All the studies in this guide are invented examples.
The definitions
OpenStax's Psychology 2e puts it simply. An independent variable "is manipulated or controlled by the experimenter". A dependent variable "is what the researcher measures to see how much effect the independent variable had".
| Independent variable | Dependent variable | |
|---|---|---|
| Role | The presumed cause or predictor | The presumed effect or outcome |
| What the researcher does | Changes, assigns or compares it | Measures it |
| Other names | Explanatory variable, predictor, factor | Response variable, outcome |
| Usual place on a graph | x-axis | y-axis |
| Typical question | What differs between the groups? | What was measured at the end? |
The word "dependent" gives you a memory aid. The dependent variable is the one that may depend on the other.
Three ways to identify them
1. The sentence test. Write "The effect of ___ on ___". The first blank is independent, and the second is dependent. "The effect of sleep on memory" gives sleep as independent and memory as dependent.
2. The time test. Ask which comes first. The independent variable usually comes first, or at least could logically come first. A person's exam score cannot change last year's study hours.
3. The researcher test. Ask what was set and what was recorded. In an experiment, what the researcher sets or assigns is independent. What the researcher records as the result is dependent.
Examples across fields
| Research question | Independent variable | Dependent variable |
|---|---|---|
| Does caffeine dose affect reaction time? | Caffeine dose | Reaction time |
| Does note-taking method affect test scores? | Laptop or handwritten notes | Test score |
| Does fertilizer amount affect plant height? | Amount of fertilizer | Plant height |
| Does a new drug lower blood pressure? | Drug or placebo | Blood pressure |
| Does class size affect reading progress? | Number of students in class | Reading progress score |
| Does an email subject line affect opens? | Subject line version | Open rate |
| Does regular exercise relate to sleep quality? | Weekly exercise | Sleep quality score |
A worked example
Read this invented abstract:
Sixty first-year students were randomly assigned to study a passage for 30 minutes either in silence, with instrumental music, or with music with lyrics. All students studied in the same room at the same time of day. One week later, they completed a 20-item recall test.
Work through it in order.
- What did the researchers change? The listening condition. This is the independent variable.
- How many levels? Three: silence, instrumental music, and music with lyrics.
- What did they measure? The recall test score. This is the dependent variable.
- What did they keep the same? Room, time of day and study time. These are control variables.
- What might still interfere? Prior knowledge of the passage topic. Random assignment helps here, since it should spread such differences across groups.
A clear statement of the design would be: "The study tested the effect of listening condition (silence, instrumental music, lyrics) on recall score."
Levels and how you measure
An independent variable needs at least two values to compare. These values are its levels. OpenStax's business statistics text calls the different values of the explanatory variable "treatments".
Both variables also need an operational definition, which says exactly how you will measure or set them. "Stress" alone is not a variable you can analyze. "Score on a named stress questionnaire, taken on the morning of the exam" is. Vague definitions cause trouble later, because a reader cannot tell what your result means.
Other variables you should know
Independent and dependent variables rarely appear alone.
| Variable | What it is | Example, in a study of exercise and sleep |
|---|---|---|
| Control variable | Kept constant or adjusted for | Age, caffeine intake |
| Confounding variable | Related to both variables, and may explain the link | Work shift pattern |
| Lurking variable | An unmeasured variable that can cloud results | Stress that nobody recorded |
| Mediator | Part of the pathway from cause to effect | Exercise reduces anxiety, which improves sleep |
| Moderator | Changes the strength of the effect | The link is stronger in older adults |
OpenStax gives a well-known illustration of confounding. Ice cream sales and crime can rise together, but temperature could explain both. Eating ice cream need not cause crime.
When nothing is manipulated
Many studies are observational. Researchers measure what already happens, with no assignment to groups. You can still label one variable independent and the other dependent, and you will also see the terms predictor and outcome here.
The distinction matters because of what you can claim. Psychology 2e is direct on this: correlation does not imply cause and effect, and establishing causation requires an experiment.
Compare these two claims about exercise and sleep:
- After a randomized experiment: "The exercise program improved sleep quality."
- After a survey: "More weekly exercise was associated with better sleep quality."
Characteristics you cannot assign, such as age, are a similar case. You can compare age groups, but you did not assign anyone to an age, so be careful with causal language.
Graphing your variables
By convention, the independent variable goes on the x-axis and the dependent variable on the y-axis. OpenStax's statistics text uses the same labels for linear equations, with x as independent and y as dependent. If your graph is the other way round, check your axes before you interpret it.
How your variables guide the analysis
The type of each variable narrows your choice of statistical test. This table is a starting point. Each test has assumptions you must check, so confirm your choice with a statistician, supervisor or your course materials.
| Independent variable | Dependent variable | Common starting point |
|---|---|---|
| Two groups | Continuous | Independent samples t-test |
| Three or more groups | Continuous | One-way ANOVA |
| Same people measured twice | Continuous | Paired t-test |
| Continuous | Continuous | Correlation or linear regression |
| Categories | Categories | Chi-square test |
| Several, of any type | Continuous | Multiple regression |
| Several, of any type | Two outcomes, such as pass or fail | Logistic regression |
Our worked example has three groups and a continuous score, so one-way ANOVA would be the place to start.
If your data are already in a CSV, Excel, SPSS or Stata file, CitedEvidence's data analysis tool can produce charts, tables and a statistics report. You still have to decide which variable plays which role. For where to state your variables in a write-up, see our guide on how to write an abstract.
Common mistakes
- Reversing them. Use the sentence test before you write up.
- Confusing the levels with the variable. "Silence" is a level. "Listening condition" is the variable.
- Calling every variable independent. Age or gender measured for description may only be background information.
- Using causal language after a survey. Write "associated with" unless your design supports more.
- Forgetting to define how you measured a variable. Name the scale, instrument or unit.
- Ignoring confounders. List likely ones when you plan the study, not after you see the results.
FAQ
Can a study have more than one independent or dependent variable?
Yes. A study can test two independent variables at once, such as dose and time of day, and can measure several outcomes. Each extra variable affects your design and analysis, so plan for it early.
Can the same variable be independent in one study and dependent in another?
Yes. The label depends on the research question. Sleep is independent in a study of sleep and memory, and dependent in a study of caffeine and sleep.
Is age an independent variable?
It can be used as one, usually as a predictor in observational work. You cannot randomly assign age, so differences between age groups may reflect other factors, and you should word your conclusions with that in mind.