Exploratory Data Analysis Lab
Profiling tables, distributions and correlations before any modelling.
- 3lessons
- 4experiments
- 5terms
Scientific introduction
Exploratory data analysis (EDA) is the systematic inspection of data to understand its structure, quality and relationships before modelling. It uses summaries and plots, and aims to generate questions and hypotheses rather than prove them.
Learning objectives
- Profile a dataset: types, missingness, duplicates
- Read distributions, skewness and kurtosis
- Compute and interpret correlation without confusing it with causation
- Spot patterns and anomalies visually and numerically
- Write a concise exploratory report
Topics
- Profiling
- Distributions
- Correlation
- Patterns
Core concepts
- Data profiling
- Inspecting data structure: types, missingness, uniqueness and range.
- Skewness
- A measure of the asymmetry of a distribution around its mean.
- Kurtosis
- A measure of tail weight compared with a normal distribution.
- Correlation
- A measure of the strength and direction of association between two variables; it does not imply causation.
- Confounder
- A third variable that affects both variables and suggests a relationship between them.
Theory
Profiling a dataset
What to do first
Before any plot, check: row and column counts, each column's type, share of missing values, number of unique values, duplicate rows, and a plausible range for each variable. Many errors appear here: a numeric column stored as text, dates in mixed formats, or a code like -999 meaning "unknown".
A practical rule
Classify columns as continuous, discrete, categorical, date or free text; each type has its own suitable summaries and plots.
Shape: distributions and skewness
Reading a distribution
A histogram reveals symmetry, skewness and multiple modes. Positive skewness means a longer right tail (the mean is usually above the median). Kurtosis describes tail weight.
Financial and duration variables are often right-skewed; a log transform may bring them closer to symmetry. Choose a suitable summary: median and quartiles for skewed data, mean and standard deviation for symmetric data.
Correlation is not causation
Pearson's coefficient
Pearson's r measures the strength of a linear relationship between two variables, between -1 and +1. r can be near zero despite a strong non-linear relationship, or large because of a single outlier.
Why it is not causation
Two variables may correlate because one causes the other, because a third factor (a confounder) drives both, or by chance. Establishing causation needs an experimental design or explicit causal assumptions, not a correlation coefficient.
Worked examples
Anscombe: four sets, identical statistics
Anscombe's four sets share nearly identical means, variances and correlation, yet look completely different. The lesson: never rely on summary numbers alone, plot the data.
Interactive experiments
Dataset profiling
Learning goal: Get a structural summary of a table: types, missingness, uniqueness.
Explanation and scientific documentation
A dataset is generated with holes at a rate you set, then each column gets its type, missing share, unique count and summary.
Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.
Numeric columns: mean, standard deviation, quartiles. Categorical: counts and the most common value.
Limits: Works on small in-memory tables; very large tables need other tools.
Correlation explorer
Learning goal: Read a correlation matrix and tell Pearson from Spearman.
Explanation and scientific documentation
The correlation matrix is computed and pairs above your threshold are highlighted.
Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.
r = Cov(X,Y)/(σXσY). Spearman is Pearson on ranks, so it reveals monotonic non-linear relations.
Limits: Correlation is not causation; the relationships here are planted by the generator.
Histogram explorer
Learning goal: Understand how bin count and a log transform change the shape.
Explanation and scientific documentation
You change the bins, apply a transform, and overlay a fitted normal curve to see departures from normal.
Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.
Skewness = E[(x−μ)³]/σ³. Too few bins hide the shape; too many amplify noise.
Limits: Bin choice changes the impression; try more than one value.
Automatic EDA report
Learning goal: Generate a brief report summarising data structure and its notable points.
Explanation and scientific documentation
Profiling, correlations and quick comparisons are computed and turned into copyable text notes.
Data: Synthetic data generated in your browser with an editable seed; the relationships are planted on purpose for learning and are not real data.
Notes come from simple rules (strong correlation, high missingness, long tail) and are not causal conclusions.
Limits: An automatic report is a starting point, not a substitute for human review.
Related algorithms and methods
Correlation matrix
A table of correlation coefficients between every pair of numeric variables.
Pearson and Spearman
Pearson for linear association, Spearman for monotonic rank association.
Suitable datasets
- Students (synthetic) Synthetic, generated in the browser
- Sales (synthetic) Synthetic, generated in the browser
- Iris Link not verified yet
Practical projects
- Exploring student performance Beginner
Assessment questions
Sources and references
- Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley (bibliographic data entered by the editor, not machine-checked)
- Anscombe, F. J. (1973). Graphs in statistical analysis. The American Statistician, 27(1), 17-21 DOI (bibliographic data entered by the editor, not machine-checked)
- Wickham, H. (2014). Tidy data. Journal of Statistical Software, 59(10) DOI (bibliographic data entered by the editor, not machine-checked)
