devnotes.

Comparison and How to Choose

Comparison and How to Choose

Side-by-side comparison

FeatureUnivariateBivariateMultivariate
VariablesOneTwoMore than two
ObjectiveDescribe a single variableExamine the relationship between two variablesUnderstand relationships among many variables
DependencyNo dependent variableOne dependent variable (usually)One or more dependent variables
TechniquesDescriptive statistics, histogramCorrelation, scatter plot, simple regressionMultiple regression, PCA, MANOVA, clustering
VisualisationHistogram, box plot, bar chartScatter plot, regression line, grouped box plotPair plot, heatmap, 3D plot, biplot
ExampleHeight of studentsTemperature vs ice-cream salesAd type, gender and click rate
ComplexityLowModerateHigh

A recommended order of exploration

  1. Univariate first. Check every variable alone: distribution, outliers, missing values.
  2. Then bivariate. Check every feature against the target, and important features against each other.
  3. Finally multivariate. Look at interactions, redundancy and structure using heatmaps, PCA and clustering.

Skipping step 1 is the most common beginner error: a single unnoticed outlier can create a fake "strong correlation" in step 2.

Decision guide

Your questionApproach
"What is the typical salary in this company?"Univariate
"Do people with more experience earn more?"Bivariate
"How do experience, education, city and role together determine salary?"Multivariate
"Which columns can I drop because they say the same thing?"Bivariate correlation then multivariate (VIF / PCA)

Quick example on one dataset

# Univariate
df["alcohol"].describe()

# Bivariate
df[["alcohol", "quality"]].corr()

# Multivariate
sns.pairplot(df[["alcohol", "sulphates", "density", "quality"]])

The same dataset is explored three ways, each answering a deeper question than the one before.

Summary

  • More variables = richer insight, but also more complexity and a bigger need for data.
  • Simple methods are not "worse"; they are the base on which complex methods stand.
  • Always match the method to the question, not the other way round.
Comparison and How to Choose | Exploratory Data Analysis | DevNotes