What Is a Variable in Research? Types & Examples

A variable in research is any characteristic, quantity, or condition that can take on different values and be measured or observed. Height, age, blood pressure, treatment type, pain level: these are all variables because they vary from person to person or from one situation to another. Variables are the building blocks of any study. Researchers design experiments and surveys around them, measuring how changes in one variable relate to changes in another.

Independent and Dependent Variables

Most research revolves around two core variables. The independent variable is the one a researcher deliberately changes or selects to study its effect. The dependent variable is the outcome being measured. Think of it this way: the dependent variable depends on what happens to the independent variable.

A straightforward example from health research makes this clear. If researchers want to know whether vehicle exhaust increases childhood asthma rates, the concentration of exhaust in the air is the independent variable. The rate of asthma in children is the dependent variable. The researchers aren’t manipulating the asthma directly; they’re watching whether it changes in response to exhaust levels. You’ll sometimes see independent variables called “predictor variables” or “experimental variables,” and dependent variables called “outcome variables.” They mean the same thing.

This pairing shows up everywhere. In a study on exercise and mood, exercise is the independent variable and mood is the dependent variable. In a trial testing whether a new therapy reduces pain, the therapy is independent and the pain score is dependent. Identifying which is which is the first step in understanding any study’s design.

Control Variables and Why They Matter

Real life is messy. Dozens of factors could influence a study’s outcome beyond the one variable a researcher is testing. Control variables are the factors a researcher deliberately holds constant so they don’t muddy the results. If you’re studying how a new diet affects blood sugar, you’d want participants to maintain similar activity levels, sleep schedules, and medication routines throughout the study. Those held-constant factors are your control variables.

Without controls, it becomes impossible to tell whether the results reflect a real effect or just background noise. Controls help scientists separate the signal from everything else happening in a complex system. In a well-designed experiment, both positive and negative controls exist to account for variability in materials and procedures alike.

Extraneous and Confounding Variables

An extraneous variable is anything you’re not investigating that could still affect your dependent variable. Not all extraneous variables are equally dangerous to your study. The ones that pose the biggest threat are confounding variables, a specific type of extraneous variable that is related to both the independent and dependent variables at the same time.

Confounding variables create a problem known as the “third variable problem.” Imagine a study finds that people who drink more coffee also have higher rates of heart disease. Before concluding that coffee causes heart problems, you’d need to rule out smoking. If coffee drinkers in the study also tend to smoke more, smoking is a confounding variable. It’s linked to both coffee consumption and heart disease, making the two appear causally related when they may not be.

If confounding variables go unaccounted for, researchers might overestimate or underestimate the true relationship between their main variables, or even report a causal link where none exists. In controlled experiments, researchers try to hold all extraneous variables constant. In observational studies where that isn’t possible, statistical techniques are used to adjust for known confounders.

Categorical vs. Numerical Variables

Variables also differ in the type of information they carry. Categorical (qualitative) variables describe labels or attributes. Smoker or non-smoker, blood type, gender: these place people into groups rather than along a number line. Even when categories have a natural order, they don’t have units or precise magnitudes.

Numerical (quantitative) variables have magnitude and units. Height in centimeters, weight in pounds, temperature in degrees. These split into two further types. Discrete variables can only be specific whole-number values, like the number of siblings someone has or the year they were born. Continuous variables can take on any value along a range, including decimals and fractions, like height (172.4 cm) or body temperature (98.6°F).

Why does this distinction matter? It determines how the data gets analyzed. Categorical outcomes are summarized with counts and percentages. Continuous variables are typically summarized with averages and measures of spread. Choosing the wrong approach leads to meaningless results.

The Four Levels of Measurement

Within these broad categories, variables can be measured at four levels of precision, each more informative than the last.

  • Nominal: Categories with no ranking. Eye color, country of birth, or diagnosis type. One value isn’t “higher” or “better” than another.
  • Ordinal: Categories with a meaningful order, but unequal spacing. A pain scale of mild, moderate, and severe tells you severe is worse than mild, but doesn’t tell you by exactly how much. The gap between mild and moderate may not equal the gap between moderate and severe.
  • Interval: Numerical values with equal spacing between each point, but no true zero. Temperature in Celsius is a classic example. The difference between 10°C and 20°C is the same as between 30°C and 40°C, but 0°C doesn’t mean “no temperature.”
  • Ratio: Like interval, but with a meaningful zero point. Weight, height, and age all qualify. Zero pounds means a genuine absence of weight, and you can say 100 kg is twice as heavy as 50 kg.

Each level up the ladder allows more types of mathematical operations. You can calculate a meaningful average for interval and ratio data, but computing the “average” of nominal categories like eye color is nonsensical.

Mediating and Moderating Variables

Beyond the basics, two types of variables help researchers understand more complex relationships. A mediating variable explains the process by which an independent variable affects a dependent variable. It sits in the middle of the causal chain. In drug prevention programs, for instance, the intervention doesn’t reduce drug use directly. Instead, it changes mediating variables like social norms and expectations about drug use, which in turn reduce actual drug use. The causal path looks like: intervention → changed social norms → reduced drug use.

A moderating variable, by contrast, changes the strength or direction of the relationship between two other variables. It answers the question “For whom does this effect hold?” A new therapy might work well for younger patients but show little benefit for older ones. In that case, age is a moderating variable. Common moderators include sex, race, age, and genetic predispositions. Where a mediator tells you how something works, a moderator tells you when or for whom it works.

Turning Concepts Into Measurable Variables

Some variables are easy to measure. Height requires a ruler, and weight requires a scale. But many research concepts are abstract: depression, quality of life, personality, stress. These need to be operationalized, meaning defined in a way that allows accurate, consistent measurement.

Operationalizing “depression,” for example, might mean using a standardized questionnaire where patients rate symptoms on a numerical scale. That transforms an abstract concept into a continuous variable with a score. Alternatively, a researcher could classify participants as “depressed” or “not depressed” based on diagnostic criteria, turning the same concept into a categorical variable. Both approaches are valid, but they capture different aspects of the same idea.

Because no single instrument perfectly captures a complex concept, strong studies often measure the same variable using multiple methods. A depression study might use a self-reported questionnaire alongside a clinician’s rating and a behavioral observation. Each method has different strengths in sensitivity, reliability, and what dimension of the variable it captures. Using several together gives a more complete and trustworthy picture of what’s actually happening.