independentyogamediatorstressdependent138mmHgblood pressuresaltconfound?
one study, many variables: the one you change, the one you measure, and the ones that sneak in

Types of variables in research: with examples

Independent, dependent, control, confounding, mediating, moderating: the types of variables in research with simple examples, the four levels of measurement, and how to define your own.

Devansh Saini is in the second year of his MSc in Yoga Science at a university in Haridwar. His dissertation asks a question he first heard from his uncle, a clerk at a bank branch in Roorkee: can a short yoga routine before work bring down blood pressure in bank staff who already have it high? He planned a twelve-week programme for 60 clerks, with half of them doing yoga and half carrying on as usual.

His synopsis came back from his guide, Dr. Meenakshi Pant, with one line circled in red: "Variables: yoga, BP, stress, age, etc." In the margin she had written, "Which one do you change? Which one do you measure? Which ones could fool you? And what is etc.?" Devansh had used the word variable for two years without ever sorting his into types.

This blog walks through the types of variables in research the way Dr. Pant walked Devansh through them: what a variable is, independent and dependent variables, control and extraneous variables, confounding variables, mediating and moderating variables, categorical and quantitative variables, the four levels of measurement, and how to name and define each variable in your own thesis.

in this blog
  1. What is a variable in research?
  2. Independent and dependent variables, with examples
  3. Control variables and extraneous variables
  4. Confounding variables: the hidden third factor
  5. Mediating vs moderating variables
  6. Categorical and quantitative variables
  7. Levels of measurement: nominal, ordinal, interval and ratio
  8. How to identify the variables in your own study

What is a variable in research?

blood pressure variesso it is a variable128146135152131
fig. 1five clerks, five readings: blood pressure varies, so it is a variable
variablenoun
any characteristic, number or quality that can take different values in a study, such as age, an exam score or a blood pressure reading.

That definition is from Editage's guide to variables, and the key word is different. If every clerk had the same blood pressure, there would be nothing to study.

Variables are sorted in two different ways, and students often mix them up:

  • By the role they play in the study: independent, dependent, control, extraneous, confounding, mediating and moderating.
  • By the kind of data they hold: categorical or quantitative, and within those, nominal, ordinal, discrete, continuous, interval or ratio.

Every variable has one type of each kind. Blood pressure is Devansh's dependent variable by role, and a continuous ratio variable by data. The role shapes your design; the data type decides your statistics.

Independent and dependent variables, with examples

independentwhat you changeyogacauses a change independentwhat you measureBPmmHgBP does not decide who did yoga
fig. 2the cause on the left, the effect on the right, and the arrow only goes one way

Every study that looks at cause and effect has these two at its centre. Editage defines the independent variable as the one a researcher changes or categorises to see its effect on another variable, the presumed cause. The dependent variable is the outcome you measure, the presumed effect.

studyindependent variabledependent variable
Devansh's yoga trialyoga routine (yes or no)systolic blood pressure after 12 weeks
a fertiliser trial on paddytype of fertilisergrain yield per hectare
a study of online classesmode of teaching (online or in person)marks in a mathematics test

If you cannot tell which is which, ask: what am I changing, or grouping people by? That is the independent variable. What am I measuring? That is the dependent variable. Then test them in a sentence: "yoga changes blood pressure" makes sense, but "blood pressure changes whether a clerk did yoga" does not.

Naming these two is also the first step in writing a hypothesis, which our guide on how to write a hypothesis explains step by step.

Control variables and extraneous variables

held constant9 to 10 am120/80one monitorno tea first5 minutes rest
fig. 3same cuff, same chair, same hour: what you hold steady cannot spoil the result

Blood pressure moves for many reasons besides yoga: a cup of tea, a rushed walk from the bus stand, a Monday morning. Editage calls any factor other than the independent variable that could affect the outcome an extraneous variable.

You deal with extraneous variables in one of two ways. You hold them constant, or you measure them so you can allow for them in the analysis. A variable you deliberately hold constant is a control variable: Editage's example is giving every participant the same room, lighting and quiz time.

Dr. Pant asked Devansh to list everything that could move a blood pressure reading. Then they decided what to fix:

  1. Same time of day.Every reading taken between 9 and 10 in the morning, before the branch opens.
  2. Same machine.One digital monitor and the same size of cuff for everyone.
  3. Same routine before the reading.Five minutes of rest, sitting, with no tea in the half hour before.
  4. Measure what cannot be fixed.Age, weight and whether a clerk takes BP medicine, recorded at the start.

You cannot make every clerk the same age, but if you record age, you can check later whether it explains part of the result.

Confounding variables: the hidden third factor

temperatureiced coffee salesheat stroke
fig. 4hot weather sells iced coffee and causes heat stroke; the coffee is not to blame

A confounding variable is the most dangerous kind of extraneous variable. The York St John University study skills factsheet defines it as a variable that is correlated with the independent variable and affects the dependent variable. Their example: when sales of iced coffee go up, so do cases of heat stroke. Iced coffee is not causing heat stroke. Temperature is pushing both up.

Devansh had a confound in his own plan. He had meant to let clerks choose whether to join the yoga group. Dr. Pant pointed out that clerks who volunteer for morning yoga may already eat less salt and walk more. If their blood pressure falls, is it the yoga, or the kind of person who signs up for yoga?

with the confound

  • health-minded clerks choose the yoga group
  • they already eat less salt
  • BP falls, and yoga gets the credit

with it controlled

  • clerks are put into groups at random
  • salt habits are spread across both groups
  • any difference left is more likely the yoga

Random assignment, matching groups on likely confounds, or measuring them and adjusting in the analysis are the usual answers. Which ones you can use depends on your research design. If you can do none of these, say so in your limitations, because a confound left unexplained is exactly what an examiner is likely to ask about.

Mediating vs moderating variables

mediator: how it worksyogastressBPmoderator: for whomyogaBPagestronger or weaker
fig. 5a mediator sits on the path; a moderator turns the dial on it

These two sound alike but do different jobs. Both involve a third variable, and each answers a different question.

typethe question it answersYork St John examplein Devansh's study
mediating variablehow or why does the independent variable affect the dependent one?more time on social media means less time with people, which leads to lonelinessyoga lowers stress, and lower stress lowers BP
moderating variablewhen or for whom is the effect stronger or weaker?practice hours improve driving test results, but less so for people who already drive wellthe effect of yoga may be weaker in clerks over 50

The factsheet points out a common slip: people call a mediator a confound. The difference is direction. A confounder changes both the independent and dependent variable. A mediator is changed by the independent variable, and then it changes the dependent one.

If it explains the route, it is a mediator. If it changes the size of the effect, it is a moderator.

Dr. Pant, to Devansh

Devansh decided to measure stress at the start and end, to test it as a mediator, and to compare clerks under and over 50, to test age as a moderator. If you draw these links as boxes and arrows, you already have the start of a conceptual framework.

Categorical and quantitative variables

categoriesnominal or ordinalclerkofficermanagercounteddiscrete20 sessionsno half sessionsmeasuredcontinuous707172737472.5 kghalf a kilo makes sense
fig. 6labels go in boxes; numbers are counted or measured

Now the second way of sorting: by the kind of data a variable holds. Editage describes qualitative or categorical variables as ones that describe a quality or category, summarised with frequencies or percentages, and quantitative variables as ones expressed in numbers, analysed with statistics such as means and standard deviations.

typewhat it holdsexample from Devansh's data
categorical, unordered (nominal)groups with no ordergender; yoga group or usual routine
categorical, ordered (ordinal)groups in a clear orderjob grade: clerk, officer, manager
quantitative, discretewhole numbers you countnumber of yoga sessions attended out of 60
quantitative, continuousany value in a range, decimals includedblood pressure, weight, age

A quick test: if "half" of it makes sense, it is continuous. Half a kilo makes sense; half a session attended does not.

Levels of measurement: nominal, ordinal, interval and ratio

nominalblood groupordinaljob gradeintervalCelsiusratioweight, BPlabels onlyequal gaps and a true zero
fig. 7four steps up: each level can do everything the one below it can, and a bit more

The psychologist S. S. Stevens set out these four scales in a paper called "On the Theory of Scales of Measurement" in Science in 1946, and they are still the best-known way of sorting data. GraphPad's guide gives a clear summary of each, and of the calculations that make sense at each level.

levelwhat it meansexampleswhat you can calculate
nominalcategories with no natural orderblood group, gender, state of birthcounts and percentages
ordinalorder matters, but the gaps between values are not equaleducation level; satisfaction from dislike to likecounts, median, percentiles
intervalequal gaps, but no true zerotemperature in Celsius, pHadds mean and standard deviation; ratios do not make sense
ratioequal gaps and a true zeroweight, length, dose, blood pressureeverything above, plus ratios

The difference between interval and ratio is easy to check. GraphPad notes that 10 degrees Celsius is not twice as hot as 5 degrees, because zero on that scale does not mean no heat. A weight of 4 grams, though, is twice as heavy as 2 grams.

Devansh's stress questionnaire used five-point answers, from "never" to "very often". Each answer is ordinal. Statisticians still debate whether a total of many such answers can be treated as interval and averaged, so follow what your field accepts, and say what you did.

You can find an average blood pressure, but not an average blood group. Our guide on qualitative vs quantitative research explains how this fits the wider choice of method.

How to identify the variables in your own study

variables of the studyvariablerolelevelyogaindependentnominalsystolic BPdependentratiostressmediatingintervalagemoderatingratioBP medicineadjusted fornominal
fig. 8Devansh's new variable table: every name has a role, a type and a way to measure it

Dr. Pant's red circle was really asking for one table. This is the order Devansh built it in.

  1. Start from your research question.The thing you change or compare is the independent variable; the thing you hope to see change is the dependent variable.
  2. List everything else that could move the outcome.Ask your guide and read similar studies. These are your extraneous variables.
  3. Decide what to do with each one.Hold it constant, measure it, or design it out with random assignment.
  4. Look for mediators and moderators.Include one only if your theory gives you a reason.
  5. Write an operational definition for every variable.Say exactly how it will be measured, with the tool and the unit.
  6. Note the type of data for each.Nominal, ordinal, interval or ratio. This decides which tests you can run.

Editage calls the fifth step operationalisation: defining a variable in specific, measurable terms. "Stress" is an idea; "the total score on a ten-item stress questionnaire" is a variable. Here is part of Devansh's final table:

variablerolehow it is measuredlevel
yoga routineindependent30 minutes, five mornings a week, for 12 weeks, or usual routinenominal
systolic BPdependentmean of two readings, digital monitor, 9 to 10 am, after 5 minutes of restratio
stressmediatingtotal score on a ten-item questionnaire, start and endtreated as interval
agemoderatingyears on the date of joining; also under 50 and 50 and overratio
BP medicinemeasured and adjusted foryes or no, from the clerk's own reportnominal

This table belongs in your methodology chapter, often under a heading such as "variables of the study". Our guide on how to write a research methodology shows where it fits. Department formats vary, so check yours.

Devansh took the new table to Dr. Pant a week later. There was no "etc." on it. She read it twice and drew a small tick beside every row.

what to remember

  • A variable is anything that can take different values in your study. Sort each one by its role and by its kind of data.
  • The independent variable is what you change or compare; the dependent variable is what you measure.
  • Extraneous variables can also move your outcome. Hold them constant as control variables, or measure them and adjust for them.
  • A confounder pushes both the cause and the effect; a mediator explains how the cause works; a moderator changes how strong the effect is.
  • Nominal, ordinal, interval and ratio levels decide which statistics you can use. Write an operational definition for every variable before you collect data.

quick questions

What are the main types of variables in research?

By role: independent, dependent, control, extraneous, confounding, mediating and moderating. By data: categorical (nominal or ordinal) and quantitative (discrete or continuous), measured at the nominal, ordinal, interval or ratio level.

What is the difference between an independent and a dependent variable?

The independent variable is the presumed cause, the one you change or group people by. The dependent variable is the presumed effect, the outcome you measure.

What is the difference between a control variable and a confounding variable?

A control variable is one you deliberately hold constant. A confounding variable is one you did not control that is linked to both your independent and dependent variables, so it can make a false link look real.

Can a variable be both independent and dependent?

Yes, in different parts of a study. A mediator is one example: stress is the outcome of yoga in one link, and a cause of blood pressure change in the next.

research basics

How to write a hypothesis: steps and examples

What a hypothesis is, what makes a good one, variables, six steps, types, null and alternative, and weak examples made strong.

11 min read
research basics

What is research design: types and examples

Descriptive, correlational, experimental, quasi-experimental, cross-sectional, longitudinal and qualitative designs, with examples and how to choose.

12 min read
research basics

Validity and reliability in research: types and examples

Validity vs reliability, their types, Cronbach's alpha, internal and external validity, and how to show both in your thesis.

11 min read