DEV Community

Cover image for From One Variable to Many: A Beginner's Guide to Univariate, Bivariate, and Multivariate Analysis
Jason Ndalamia
Jason Ndalamia

Posted on AI-assisted

From One Variable to Many: A Beginner's Guide to Univariate, Bivariate, and Multivariate Analysis

Imagine you're given a dataset containing information about 10,000 customers: age, income, purchases, advertising exposure, satisfaction, and churn.

Where do you start?

You could jump straight into machine learning, but a better first step is to understand the data.

This is where three fundamental types of analysis come in:

Univariate, bivariate, and multivariable/multivariate analysis.

Think of them as three levels of questions:

  • Univariate: What does one variable look like?
  • Bivariate: How are two variables related?
  • Multivariable: What happens when several variables are considered together?

Let's break them down.


1. Univariate Analysis: Understand One Variable

Univariate analysis focuses on one variable at a time.

Suppose we want to understand customer age.

We might ask:

  • What is the average age?
  • What is the median?
  • How spread out are the ages?
  • Are there unusual values?
  • Is the distribution skewed?

Common measures include:

Mean, median, mode, range, standard deviation, quartiles, and percentiles.

We can also visualize the variable using a:

  • Histogram
  • Box plot
  • Bar chart for categorical data

Univariate analysis is often the first step because it can reveal outliers, missing values, unusual categories, or unexpected distributions before we move into more complex analysis.

Before asking how variables relate to each other, understand each variable on its own.


2. Bivariate Analysis: Look at Relationships

Now suppose we want to examine advertising exposure and purchases.

We have two variables, so this is bivariate analysis.

We might ask:

Do customers who see more advertisements tend to make more purchases?

For two numerical variables, we can use:

  • Scatter plots
  • Correlation
  • Simple linear regression

For example, a correlation of 0.78 suggests a strong positive linear relationship.

But there's an important lesson:

Correlation does not mean causation.

If ice-cream sales and swimming accidents both increase during the same period, that doesn't mean ice cream causes accidents. A third factor, such as hot weather, may influence both.

So whenever you find a relationship, ask:

What else could explain it?

Bivariate analysis can also use other methods depending on the types of variables involved. For example, categorical variables can be examined using cross-tabulations and chi-square tests.


3. Multivariable Analysis: Real-World Data Is More Complicated

In reality, outcomes rarely depend on just one factor.

Customer purchases might be influenced by:

  • Advertising
  • Income
  • Age
  • Satisfaction
  • Product price

Instead of asking:

"Is advertising related to purchases?"

we can ask:

"How are advertising, income, age, and satisfaction related to purchases when considered together?"

This is where multiple regression can be useful.

A simplified model might look like:

$$
Purchases = \beta_0 + \beta_1(Advertising) + \beta_2(Income) + \beta_3(Age) + \beta_4(Satisfaction)
$$

The important idea is not the formula. It's the question:

What happens when we consider several predictors at the same time?

This is much closer to how real-world data works.

Watch out for multicollinearity

When predictors are strongly related to each other, we can have multicollinearity.

For example, using both:

  • Age
  • Years since graduation

might introduce overlapping information.

This can make it harder for a regression model to estimate the individual contribution of each predictor.


Multivariable vs Multivariate

You may see these terms used interchangeably, but technically they are different.

Multivariable analysis usually involves:

Multiple predictors → one outcome

For example:

Salary ← Education + Experience + Location

Multivariate analysis involves multiple outcome variables being analyzed together.

For beginners, the key idea is simply:

As the number of variables increases, the questions and analytical techniques become more complex.


A Simple Way to Remember

Imagine you're analyzing customer data.

Univariate

Age

What does the age distribution look like?

Bivariate

Advertising + Purchases

Are they related?

Multivariable

Advertising + Income + Age + Satisfaction → Purchases

What happens when we consider several factors together?

That's the progression.


Why This Matters

It's tempting to jump straight into machine learning, but strong data analysis starts with understanding the data.

A simple workflow is:

Understand → Explore → Compare → Model → Interpret

The goal isn't to use the most complicated statistical method.

It's to use the right method for the question you're trying to answer.

And that is where good data analysis begins.

Top comments (0)