Data Analysis

Independent vs Dependent Variables, with Examples

Updated November 12, 2026
45 views

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 variableDependent variable
RoleThe presumed cause or predictorThe presumed effect or outcome
What the researcher doesChanges, assigns or compares itMeasures it
Other namesExplanatory variable, predictor, factorResponse variable, outcome
Usual place on a graphx-axisy-axis
Typical questionWhat 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 questionIndependent variableDependent variable
Does caffeine dose affect reaction time?Caffeine doseReaction time
Does note-taking method affect test scores?Laptop or handwritten notesTest score
Does fertilizer amount affect plant height?Amount of fertilizerPlant height
Does a new drug lower blood pressure?Drug or placeboBlood pressure
Does class size affect reading progress?Number of students in classReading progress score
Does an email subject line affect opens?Subject line versionOpen rate
Does regular exercise relate to sleep quality?Weekly exerciseSleep 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.

  1. What did the researchers change? The listening condition. This is the independent variable.
  2. How many levels? Three: silence, instrumental music, and music with lyrics.
  3. What did they measure? The recall test score. This is the dependent variable.
  4. What did they keep the same? Room, time of day and study time. These are control variables.
  5. 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.

VariableWhat it isExample, in a study of exercise and sleep
Control variableKept constant or adjusted forAge, caffeine intake
Confounding variableRelated to both variables, and may explain the linkWork shift pattern
Lurking variableAn unmeasured variable that can cloud resultsStress that nobody recorded
MediatorPart of the pathway from cause to effectExercise reduces anxiety, which improves sleep
ModeratorChanges the strength of the effectThe 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 variableDependent variableCommon starting point
Two groupsContinuousIndependent samples t-test
Three or more groupsContinuousOne-way ANOVA
Same people measured twiceContinuousPaired t-test
ContinuousContinuousCorrelation or linear regression
CategoriesCategoriesChi-square test
Several, of any typeContinuousMultiple regression
Several, of any typeTwo outcomes, such as pass or failLogistic 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.

Still stuck?Ask the CitedEvidence team and other researchers on Discord.