The definition of a variable changes depending on the context. Typically, a letter represents them, and it stands in for a numerical value. In algebra, a variable represents an unknown value that you need to find. For mathematical functions and equations, you input their values to calculate the output. In an equation, a coefficient is a fixed value by which you multiply the variable.

In statistics, a variable is a characteristic of interest that you measure, record, and analyze. Statisticians understand them by defining the type of information they record and their role in an experiment or study.

In this post, learn about the different kinds of variables in statistics and their functions in experiments.

## Variables Record Different Types of Information

There are many different kinds of information. Consider your personal information, such as height, marital status, and the number of people in your family. All of them are about you, but they capture fundamentally different kinds of data.

Statisticians have devised various methods for categorizing variables to help you understand their differences. Below are several key ways to group them by the information they record.

### Quantitative vs. Categorical

Quantitative variables record amounts and quantities. For example, you used 15.7 gallons on your latest road trip. You walked 11,353 steps yesterday. The plant grew 5.6 cm in a week. Each of these examples quantifies a characteristic.

Categorical variables define groups in your data. Frequently, you use descriptive language for these groups. For example, marital status, college major, type of fiction (drama, comedy, science fiction, etc.), and architectural style are all categorical and form groups in your data.

In an experiment, the treatment condition is a categorical variable that forms the experimental groups. In a plant fertilizer experiment, treatment condition divides the specimens into the control group and other groups based on fertilizer type.

### Discrete vs. Continuous

When you have a quantitative variable, it can be discrete or continuous.

In broad terms, the difference between the two is the following:

- You count discrete data.
- You measure continuous data.

Discrete variables can only take on specific values that you cannot subdivide. Frequently, discrete data are values that you count and, consequently, are nonnegative integers. For example, you can count the number of people in your household and the number of steps per day.

Continuous variables can assume any value and you can meaningfully divide them into smaller parts, such as fractional and decimal values. Theoretically, continuous data have infinite values between any two values. Typically, you measure them using a scale.

For example, you have continuous data when measuring weight, height, length, time, and temperature.

**Related post**: Discrete vs. Continuous Data

Statisticians have devised various methods for categorizing data by the types of information they contain. To learn about another approach for organizing data types, read my post about Nominal, Ordinal, Interval, and Ratio Scales.

### Random Variables

In statistics, most of the data you analyze are random variables, which are functions describing all values that occur during a series of random events or experiments. They can represent categorical, discrete, and continuous data. Examples include the following:

- Flipping coins or rolling dice and recording the results.
- Drawing a random sample and measuring heights.
- Performing a fertilizer experiment and recording plant growth.

In the preceding examples, an event provides a single value. However, a random variable comprises the entire set of possible values in your sample space.

For random variables, statisticians frequently assess the distribution of possible values, including the central tendency, spread, and skewness. Additionally, probability distribution functions describe the likelihood of obtaining particular values. All these properties provide vital information about the attribute you’re studying.

**Related posts**: Measures of Central Tendency, Measures of Variability, and Understanding Probability Distributions

## Variables Play Different Roles in an Experiment

Finally, thinking about a variable’s role in an experiment or statistical study can help you better understand it.

### Dependent Variables

In an experiment, you measure an outcome variable of interest. If you’re studying plant growth, infection rates, or bone density, that will be the outcome you measure. We call these dependent variables because their values depend on other variables in the study that I discuss below.

### Independent Variables

In true experiments, researchers control the experimental conditions by assigning each subject to a treatment or control group. In other words, they can set the value of the variable they think will cause changes in the outcome. For example, in a plant growth study, the researchers control whether each plant receives fertilizer or not. When determining if a new vaccine reduces infection rates, they assign participants to either the vaccine or placebo group. Statisticians refer to this type of variable as an independent variable.

Learn more about Independent and Dependent Variables.

### Control Variables

Control variables are not the primary focus of the research, but they are properties that researchers need to monitor because they can influence the outcome. Failure to incorporate them into a study can bias the findings. To prevent this bias, scientists can either hold these characteristics constant during the study or let them vary and include them in their models to control them statistically.

Suppose you’re performing a plant growth experiment, and you’re using several types of fertilizer and a control group with no fertilizer. The researchers might measure additional attributes that also affect plant growth. For example, they can record the temperature, moisture, and light conditions.

Learn more about Control Variables.

For more information about graphing and analyzing data for different types of variables, read the following posts:

- Data Types and How to Graph Them
- Hypothesis Testing by Data Types
- Choosing the Correct Type of Regression Analysis

## Reference

Stevens, S.S., On the Theory of Scales of Measurement, Science, 1946

## Comments and Questions