├── Statistics
│ ├── Descriptive Statistics
│ │ ├── Mean, Median, Mode
│ │ ├── Standard Deviation
│ │ └── Percentiles / Quartiles
│ ├── Inferential Statistics
│ │ ├── Hypothesis Testing
│ │ ├── p-Value
│ │ ├── Confidence Intervals
│ │ └── A/B Testing
│ ├── Correlation vs Causation
│ └── Sampling Methods
│ ├── Random Sampling
│ ├── Stratified Sampling
│ └── Bootstrap
Statistics exists to answer two fundamental questions about data:
- “What do we have?” → Summarizing or describing data we already collected.
- “What can we infer?” → Making generalizations or predictions about a larger population from a sample.
Descriptive Statistics
Goal: Summarize and describe the main features of a dataset. It doesn’t generalize or predict it only describes what is actually observed.
You surveyed 100 people and found:
- Average height = 170 cm
- Minimum = 150 cm
- Maximum = 190 cm
- 60% are male
These numbers describe your sample they do not claim anything about all people in the world.
| Category | Examples | Purpose |
|---|---|---|
| Measures of Central Tendency | Mean, Median, Mode | Show the center or typical value |
| Measures of Dispersion | Range, Variance, Standard Deviation | Show how spread out data is |
| Graphical Tools | Histograms, Pie Charts, Box Plots | Visualize data distribution |
| Measures of Shape | Skewness, Kurtosis | Describe asymmetry or peakedness |
Inferential Statistics
Goal: Make conclusions or predictions about a population based on a sample.
Because we can’t measure everyone, we collect a sample, compute statistics on it, and infer population-level patterns while accounting for uncertainty.
You measure the average height of 100 people in a city (170 cm) and infer that the average height of the whole city’s population is likely close to that but not exact.
You quantify that uncertainty using confidence intervals or hypothesis tests.
| Category | Examples | Purpose |
|---|---|---|
| Estimation | Confidence Intervals, Point Estimates | Estimate population parameters |
| Hypothesis Testing | t-test, chi-square, ANOVA | Test if observed effects are significant |
| Regression & Correlation | Linear regression, correlation coefficient | Model relationships between variables |
| Probability Models | Normal distribution, binomial, Poisson | Model random variation |
outlier
An outlier is a data point that is inconsistent with the overall pattern of the dataset.
Heights of adults (in cm):
160, 162, 165, 170, 172, 168, 450
Here, 450 cm doesn’t fit the pattern it’s likely an error or a completely different kind of observation.
So:
- Normal variation: within the expected range.
- Outlier: outside the expected range.
to Detect Outliers
There’s no single universal definition, but several statistical rules of thumb are widely used.
(a) Z-Score Method (Standard Deviation Rule)
If data is roughly normal (bell-shaped):
where
- ( x ) = data point
- ( \mu ) = mean
- ( \sigma ) = standard deviation
If |Z| > 3 → it’s far from the mean by more than 3 standard deviations → potential outlier.
(Why 3?) In a normal distribution, 99.7% of points fall within ±3σ. So anything beyond that is extremely rare.
(b) IQR Method (Boxplot Rule)
Works well for non-normal data.
- Find Q1 (25th percentile) and Q3 (75th percentile).
- Compute IQR = Q3 – Q1.
- Define limits:
- Any point outside this range is a potential outlier.
(Why 1.5×IQR?) It empirically captures ~99% of central data for many typical distributions, while flagging extremes.
(c) Visual Methods
- Box Plot: Outliers appear as dots outside whiskers.
- Scatter Plot: Useful for multivariate outliers.
- Histogram: Can show gaps or tails where outliers live.
Five number summary
Every dataset can be summarized along two main questions:
- Where are the values located? (center, extremes)
- How are they spread out? (variation, range)
The five-number summary is a compact way to describe both using five key points that divide and bound your data.
It’s especially useful for non-normal, skewed, or small datasets, where mean and standard deviation can be misleading.
| Position | Symbol | Name | Description |
|---|---|---|---|
| 1 | Min | Minimum | Smallest value in dataset |
| 2 | Q1 | First Quartile (25th percentile) | Value below which 25% of data lies |
| 3 | Median (Q2) | Second Quartile (50th percentile) | Middle value (splits data in half) |
| 4 | Q3 | Third Quartile (75th percentile) | Value below which 75% of data lies |
| 5 | Max | Maximum | Largest value in dataset |
Let’s take a simple dataset: Data: [2, 4, 5, 7, 8, 10, 12, 13, 14, 18]
Step 1 — Order the data: (Already sorted)
Step 2 — Find the median (Q2): Middle value between 8 and 10 → (8 + 10)/2 = 9.
Step 3 — Split into halves:
- Lower half: [2, 4, 5, 7, 8]
- Upper half: [10, 12, 13, 14, 18]
Step 4 — Find Q1 (median of lower half): = 5
Step 5 — Find Q3 (median of upper half): = 13
Step 6 — Min = 2, Max = 18
Five-number summary: [2, 5, 9, 13, 18]
| Value | What It Represents | What It Tells You |
|---|---|---|
| Min | Lower bound | Smallest observed value |
| Q1 | Lower quartile | Start of central 50% |
| Median (Q2) | Center | Central location |
| Q3 | Upper quartile | End of central 50% |
| Max | Upper bound | Largest observed value |
The middle 50% of the data lies between Q1 and Q3. The spread of that zone is called the IQR (Interquartile Range):
The five-number summary directly generates a box plot, which visualizes:
Min Q1 Median Q3 Max
|----|=====|====|----|
- The box spans from Q1 to Q3 (the interquartile range).
- The line inside the box marks the median.
- The whiskers extend to Min and Max (or sometimes to limits before outliers).
So, the five-number summary is the numerical backbone of the box plot.