The types of variables in research fall into two broad families: variables classified by the role they play in a study (independent, dependent, controlled, extraneous, confounding, mediating and moderating) and variables classified by the type of data they hold (categorical versus numerical, and discrete versus continuous). A variable is simply any characteristic, condition or value that can change or differ between people, objects, time points or conditions — such as age, exam score, treatment group or job satisfaction.
Knowing which type of variable you are dealing with is not an academic nicety. It determines how you measure each concept, how you design your study, and — crucially — which statistical test is valid. Choose the wrong classification and your entire analysis chapter can collapse. This guide defines every major variable type, illustrates each with a recognisable dissertation example, and shows you how variable type drives your choice of test.
What is a variable?
A variable is anything that can take more than one value across the units in your study. Height, gender, reaction time, brand preference, hours of revision and blood pressure are all variables because they vary from one case to the next. If something cannot vary — it is the same for everyone in your sample — it is a constant, not a variable. In research design, variables are the operational stand-ins for the abstract constructs your theory talks about: “academic motivation” is a construct; the score on a validated motivation questionnaire is the variable you actually measure. Getting from construct to measurable variable is the work of operationalisation, and the quality of that step governs your study’s reliability and validity.
Variables are classified along two independent dimensions. The first asks what part the variable plays in your causal or relational argument — this gives the role-based types (independent, dependent and so on). The second asks what kind of values the variable can take — this gives the data-type classification (categorical versus numerical). A single variable is described by both: “treatment group” might be an independent, categorical, nominal variable; “exam score” might be a dependent, numerical, continuous variable. The two systems answer different questions, and you need both.
Master table: every variable type at a glance
The table below summarises the seven role-based types and the data-type families. Use it as a reference card while you draft your methodology, then read the sections beneath for the detail and the worked example that ties them together.
| Category | Variable type | What it does | Example |
|---|---|---|---|
| By role | Independent (IV) | The presumed cause; what you manipulate or compare | Type of revision technique (spaced vs massed) |
| Dependent (DV) | The presumed effect; the outcome you measure | Exam score (%) | |
| Controlled | Held constant so it cannot influence the DV | Same exam paper, same room temperature | |
| Extraneous | Any other variable that could affect the DV | Participants’ prior knowledge, time of day | |
| Confounding | An extraneous variable linked to BOTH IV and DV, distorting the result | Hours of sleep (if it differs between groups) | |
| Mediating | Explains the mechanism: IV → mediator → DV | Information retention links technique to score | |
| Moderating | Changes the strength/direction of the IV–DV link | Prior ability (effect bigger for weaker students) | |
| By data type | Nominal (categorical) | Named categories with no order | Gender, nationality, blood type |
| Ordinal (categorical) | Ordered categories, unequal/unknown gaps | Likert agreement, degree class, pain rating | |
| Interval (numerical) | Ordered, equal intervals, no true zero | Temperature in °C, IQ score | |
| Ratio (numerical) | Equal intervals plus a meaningful zero | Age, income, reaction time, weight |
Variables by role
Role-based classification is the language of experimental and quantitative research. It tells the reader of your methodology chapter which variable you think causes what, and what you have done about everything else that might interfere.
Independent variable (IV)
The independent variable is the presumed cause — the factor you deliberately manipulate (in an experiment) or select and compare (in a quasi-experiment or survey). It is “independent” because, within the study, its value does not depend on the other variables; you set it. In a true experimental study you assign participants to levels of the IV at random. Example: a researcher comparing two teaching methods makes “teaching method” (interactive vs lecture) the IV.
Dependent variable (DV)
The dependent variable is the presumed effect — the outcome you measure to see whether the IV made a difference. Its value is expected to depend on the IV. There is usually one DV per hypothesis, and it must be operationalised precisely. Example: if teaching method is the IV, “end-of-term test score” is the DV. A simple sentence test helps students keep them straight: “the effect of [IV] on [DV].”
Controlled variables
A controlled variable is one you deliberately hold constant so it cannot vary across conditions and muddy the comparison. Controlling variables is how you isolate the IV’s effect. Example: in the teaching-method study you would use the same syllabus content, the same test, the same time allotment and ideally the same teacher for both groups so that only the method differs.
Extraneous variables
An extraneous variable is any variable other than the IV that could influence the DV. Extraneous variables are everywhere — participants’ mood, motivation, prior knowledge, the time of day, room noise. Good design anticipates them and neutralises them through control, randomisation or measurement. An extraneous variable becomes dangerous only when it is allowed to vary systematically with the IV — at which point it becomes a confounder.
Confounding variables
A confounding variable is an extraneous variable that is related to both the independent and the dependent variable, so its influence is tangled up with — and indistinguishable from — the IV’s. Confounders are the single biggest threat to a causal claim, because they offer a rival explanation for your result. If the “interactive teaching” group also happened to contain more high-ability students, you could not tell whether better scores came from the method or the students. Randomisation, matching and statistical control (e.g. ANCOVA) are the main defences. We cover this in depth in our guide to confounding variables.
Mediating variables
A mediating variable (or mediator) sits in the causal chain between the IV and the DV and explains how or why the effect happens: IV → mediator → DV. Mediation answers the mechanism question. Example: spaced revision (IV) improves exam scores (DV) because it improves long-term retention (mediator). If retention fully accounts for the effect, the link between technique and score should weaken once retention is held constant — the logic behind mediation analysis.
Moderating variables
A moderating variable (or moderator) changes the strength or direction of the relationship between the IV and the DV. It answers “for whom, or under what conditions, is the effect stronger or weaker?” Statistically, a moderator shows up as an interaction effect. Example: the benefit of spaced revision might be larger for lower-ability students and smaller for high-ability ones — here prior ability moderates the IV–DV relationship. Note the contrast: a mediator is part of the causal pathway, whereas a moderator conditions it from the outside.
Independent variable: revision schedule (spaced vs massed). Dependent variable: score on a 40-mark exam. Controlled variables: identical study material, the same exam paper, the same 60-minute test window. Extraneous variables: motivation, prior grades, sleep. Confounding variable (the trap): if more high-achieving students happened to land in the spaced group, prior ability would be confounded with the IV — random assignment is what prevents this. Mediator: long-term retention (the spacing effect works through better retention). Moderator: prior ability, if spacing helps weaker students more. The result is a clean test of the IV’s effect on the DV with rival explanations designed out.
Variables by data type
The second classification — by the kind of data a variable produces — is what actually dictates which statistics you may use. It maps directly onto the four levels of measurement: nominal, ordinal, interval and ratio. The first split is between categorical and numerical variables.
Categorical variables (qualitative)
Categorical variables place each case into a category or group; the “values” are labels, not quantities. They divide into two sub-types:
- Nominal variables — named categories with no inherent order. Examples: gender, nationality, marital status, eye colour, type of degree. You can count how many fall in each category, but “more” or “less” is meaningless.
- Ordinal variables — categories that do have a meaningful order, but the gaps between them are unequal or unknown. Examples: a five-point Likert agreement scale, degree classification (first, 2:1, 2:2, third), or a survey response of “low / medium / high”. You know the rank order, but you cannot say the distance from “agree” to “strongly agree” equals the distance from “neutral” to “agree.”
Numerical variables (quantitative)
Numerical (quantitative) variables take genuine numeric values you can do arithmetic with. They split into interval and ratio at the measurement-level layer, and into discrete and continuous at the structural layer.
- Interval variables have ordered values with equal spacing but no true (absolute) zero. Temperature in degrees Celsius is the classic case: the gap between 10° and 20° equals the gap between 20° and 30°, but 0°C does not mean “no temperature,” so 20° is not “twice as hot” as 10°. IQ scores are usually treated this way.
- Ratio variables have all the properties of interval data plus a meaningful zero, which makes ratios valid. Examples: age, income, weight, reaction time, number of correct answers. Here 0 means a true absence, and 40 years really is twice 20 years.
Discrete versus continuous
A separate, very useful distinction within numerical variables concerns whether the values are countable or measurable:
- Discrete variables take separate, countable values with gaps in between — typically whole numbers. Examples: number of children, count of customer complaints, number of correct exam answers. You cannot have 2.5 children.
- Continuous variables can take any value within a range, including fractions and decimals, limited only by the precision of your instrument. Examples: height, weight, time, temperature, blood pressure. Between any two values there is always another possible value.
So a single numerical variable carries two descriptors: “reaction time” is ratio and continuous; “number of complaints” is ratio and discrete.
Quantitative versus qualitative variables
At the broadest level, the data-type families collapse into two: quantitative variables (numerical — interval and ratio) capture how much or how many, while qualitative variables (categorical — nominal and ordinal) capture what kind or which group. This mirrors, but is not identical to, the wider distinction between quantitative and qualitative research: a quantitative study can still contain qualitative variables such as gender or region. The label describes the variable’s data, not the whole project.
“Measurement is the assignment of numerals to objects or events according to rules. … The fact that numerals can be assigned under different rules leads to different kinds of scales and different kinds of measurement.” (Source: Stevens, 1946, ‘On the Theory of Scales of Measurement’, Science)
S. S. Stevens’s four-level framework — nominal, ordinal, interval, ratio — remains the foundation of how variables are classified by data type, and it is precisely this classification that determines which statistical procedures are legitimate.
How variable type drives the choice of statistical test
This is where classification pays off. The data type of your dependent variable, combined with the number and type of independent variables, narrows your test almost mechanically. The table below shows common pairings; for the underlying logic, see our guide to hypothesis testing.
| Research aim | IV (predictor) | DV (outcome) | Typical test |
|---|---|---|---|
| Compare two groups’ means | Categorical (2 groups) | Numerical (continuous) | Independent-samples t-test |
| Compare three+ groups’ means | Categorical (3+ groups) | Numerical (continuous) | One-way ANOVA |
| Association between two categoricals | Categorical (nominal) | Categorical (nominal) | Chi-square test of independence |
| Strength of a linear relationship | Numerical (continuous) | Numerical (continuous) | Pearson’s correlation |
| Relationship using ranked/ordinal data | Ordinal | Ordinal | Spearman’s rank correlation |
| Predict an outcome from predictors | Numerical / mixed | Numerical (continuous) | Linear regression |
| Predict a yes/no outcome | Numerical / mixed | Categorical (binary) | Logistic regression |
Two rules of thumb capture most of it: (1) a continuous DV points toward means-based parametric tests (t-tests, ANOVA, Pearson, regression), provided assumptions such as normality hold; (2) a categorical DV, or ordinal data, points toward non-parametric or frequency-based tests (chi-square, Mann–Whitney, Spearman, logistic regression). Misclassifying an ordinal Likert item as interval, or treating a discrete count as continuous, is one of the most common reasons a dissertation‘s statistics get challenged in the viva.
A health researcher asks whether a new 8-week mindfulness app reduces anxiety. She randomly assigns 80 employees to either the app condition or a waitlist control, and measures anxiety on the GAD-7 scale (0–21) before and after.
Independent variable (IV): condition — app vs waitlist (categorical, nominal, 2 groups). Dependent variable (DV): post-intervention GAD-7 score (numerical, continuous). Controlled variables: same 8-week window, same GAD-7 instrument, same reminder schedule. Extraneous variable: baseline anxiety and daily workload. Confounder (the trap): if the app group also happened to have lighter workloads, workload would be tangled with the IV — random assignment is what designs this out. Moderator: baseline severity — the app may help highly anxious staff more than mildly anxious staff, changing the strength of the IV–DV effect.
Which test & why: the DV is continuous and the IV is a categorical, two-level grouping, so the natural choice is an independent-samples t-test comparing the two groups’ mean post-scores (or, to remove the baseline-anxiety extraneous variable statistically, an ANCOVA with baseline GAD-7 as a covariate). To test the moderator, baseline severity enters as an interaction term in a regression / two-way ANOVA — a significant interaction confirms moderation. A chi-square or correlation would be wrong here: chi-square needs a categorical DV, and a correlation needs a continuous IV, neither of which this design has.
Not sure which test fits your variables?
Our statisticians classify your variables, run the right analysis in SPSS or R, and write up the results chapter for you.
Common mistakes with variables
- Confusing the IV and DV. Always phrase your hypothesis as “the effect of [IV] on [DV]”; the thing you change is the IV, the thing you measure is the DV.
- Ignoring confounders. Failing to randomise or control means a confounding variable can give you a result you cannot defend. Identify plausible confounders before you collect data.
- Treating ordinal data as interval. Averaging a single Likert item and running a t-test on it is a frequent and challengeable error; the gaps between points are not equal.
- Mixing up mediators and moderators. A mediator explains why (it is on the causal path); a moderator explains when/for whom (it changes the strength). They require different analyses.
- Forgetting to operationalise. “Well-being” is a construct; you must specify the exact measured variable (e.g. WHO-5 score) before anyone can replicate you.
How to classify your variables well: a quick process
- List every variable in your research question and hypotheses.
- Assign a role to each — IV, DV, controlled, mediator or moderator — and flag any extraneous variables that could become confounders.
- Decide the data type for each measured variable: categorical (nominal/ordinal) or numerical (interval/ratio), and note discrete vs continuous.
- Operationalise each construct into a concrete, measurable variable with a defined scale.
- Map to a test using the data type of your DV and the number/type of IVs.
- Plan your controls — randomisation, matching or statistical adjustment — to neutralise confounders before data collection begins.
Done in this order, variable classification stops being guesswork and becomes the backbone of a defensible methodology and a clean results chapter.