Statistics for Data Analysis & Data
Science
Complete Lecture Notes · All Major Topics
Contents
01 Introduction to Statistics 07 Correlation & Covariance
02 Types of Data & Variables 08 Probability
03 Population & Sampling 09 Probability Distributions
04 Descriptive Statistics 10 Normal Distribution
05 Measures of Dispersion 11 Inferential Statistics
06 Graphical Representation 12 Hypothesis Testing
01 Introduction to Statistics
A branch of mathematics involving collecting, analyzing, interpreting, and drawing conclusions from data.
Two Types of Statistics
Descriptive Statistics Inferential Statistics
Summarizes and describes data using measures, Draws conclusions about a population based on a
graphs, and tables. First step in any analysis. sample. Includes estimation and hypothesis testing.
Data Analysis Workflow
Step Action
1 Define the problem / research question
2 Collect data (surveys, experiments, existing datasets)
3 Clean data — remove inconsistencies and handle missing values
4 Exploratory Data Analysis (EDA) — understand distributions and patterns
5 Transform data (normalize, encode categorical variables)
6 Formulate hypothesis (null and alternate)
7 Apply statistical tests
8 Interpret results — accept or reject hypothesis
9 Document analysis and create a report
02 Types of Data & Variables
Data Categories
Type Description Example
Structured Organized in rows and columns Excel sheets, databases
Unstructured No fixed structure Images, audio, emails, web
pages
Cross-sectional Collected at a single point in time Survey data, exam marks
Time Series Collected over a sequence of time intervals Daily stock prices, monthly
sales
Univariate Single variable in dataset Height of students
Multivariate Two or more variables Age, salary, and height
together
Types of Variables
Variable Type Description Example
Nominal Categories with no order Gender (Male/Female),
Colours
Ordinal Categories with order; unequal intervals Education level, Ratings 1-5
Discrete (Numerical) Countable integer values Number of students
Continuous (Numerical) Any value in an interval Height, Weight, Temperature
Interval Meaningful intervals; no true zero Temperature in Celsius, IQ
score
Ratio Meaningful intervals plus true zero Height, Weight, Age
Note: Numerical data uses Interval and Ratio types. Categorical data uses Nominal and Ordinal types.
03 Population & Sampling
Population Sample
The entire group being studied. e.g. All people in A representative subset of the population.
India Recommended: n > 30 for reliable inference.
Sampling Techniques
Technique How it works Key distinction
Random Every person has equal chance — no system Simplest method
Stratified Divide into sub-groups (strata), then randomly pick Picks individuals from
individuals from each every group
Technique How it works Key distinction
Systematic Select every k-th element (e.g. every 10th person) Follows a fixed interval rule
Cluster Divide into clusters, then randomly select entire clusters Picks whole groups, not
individuals
Note: Stratified vs Cluster: Stratified selects individuals from each group; Cluster selects entire groups at
random.
04 Descriptive Statistics — Central Tendency
Measure Definition Formula / Notes
Mean Sum of all values divided by count. Sensitive to x-bar = Sum(xi) / n
outliers.
Median Middle value when sorted. For even n: average of Less affected by outliers — use
two middle values. when outliers exist
Mode Most frequently occurring value. Best for categorical variables.
Can be none, one, or multiple.
When to Use Which Measure
Situation Recommended Measure
Numerical data, no outliers Mean
Numerical data with outliers or skewed distribution Median
Categorical data Mode
Frequency Concepts
Term Definition
Frequency Number of times a value appears in the dataset
Relative Frequency Frequency divided by total observations (gives proportion or percentage)
Cumulative Frequency Running total of frequencies — always non-decreasing
05 Measures of Dispersion
Describe the spread or variability of data around the central tendency.
Measure Definition Formula
Range Difference between max and min. Simple but Max - Min
sensitive to outliers.
IQR Spread of the middle 50% of data. Less sensitive Q3 - Q1
to outliers.
Measure Definition Formula
Variance Average squared deviation from the mean. Units o^2 = Sum(xi - u)^2 / n
are squared.
Standard Deviation Square root of variance. Same unit as original o = sqrt(Variance)
data.
Quartiles & Percentiles
Quartile Percentile Formula (gives term position)
Q1 (lower quartile) 25th percentile (n+1) / 4
Q2 (median) 50th percentile (n+1) / 2
Q3 (upper quartile) 75th percentile 3(n+1) / 4
Any percentile P -- (P/100) x (n+1)
06 Graphical Representation & Outliers
Histogram
Displays distribution of continuous data using bins. Y-axis = frequency or density.
Type Shape Mean vs Median
Symmetric (Normal) Bell-shaped, balanced on both sides Mean = Median = Mode
Right Skewed (+) Long tail on the right; outliers on right Mean > Median
Left Skewed (-) Long tail on the left; outliers on left Mean < Median
Mode-based type Description
Unimodal One peak in the distribution
Bimodal Two peaks
Multimodal Many peaks — no single dominant mode
Box Plot (Whisker Plot) — 5-Number Summary
Element Value / Formula
Minimum Lowest non-outlier value
Q1 (lower quartile) 25th percentile
Median (Q2) 50th percentile — line inside the box
Q3 (upper quartile) 75th percentile
Maximum Highest non-outlier value
Upper whisker Q3 + 1.5 x IQR
Element Value / Formula
Lower whisker Q1 - 1.5 x IQR
Outliers Values beyond either whisker — plotted as individual points
Scatter Plot
Visualizes the relationship between two continuous variables. Identifies positive, negative, or no
correlation, and is also useful for detecting outliers.
Pattern Meaning
Points trend upward (left to right) Positive correlation — both variables increase together
Points trend downward (left to right) Negative correlation — one increases as the other decreases
No visible pattern No correlation — variables are unrelated
Outlier Detection Methods
Method Rule
IQR Method Outlier if value < Q1 - 1.5xIQR or value > Q3 + 1.5xIQR
Z-score Method Outlier if |z| > 3 (beyond 3 standard deviations from mean)
07 Correlation & Covariance
Covariance Correlation Coefficient (r)
Shows direction of relationship (positive/negative). Shows both direction and strength. Range: -1 to +1.
Does not indicate strength.
Formula: r = Cov(x,y) / (sigma-x x sigma-y)
Formula: Cov(x,y) = Sum[(xi - x-bar)(yi - y-bar)] / n
Correlation Value Interpretation
r close to +1.0 Strong positive correlation
r close to -1.0 Strong negative correlation
r close to 0 No or very weak correlation
+/- 0.7 to +/- 1.0 Strong correlation
-0.5 to +0.5 Weak correlation
Note: Correlation does not imply Causation. Two variables can be correlated without one causing the
other.
08 Probability
Probability is the measure of the likelihood of an event occurring. Range: 0 (impossible) to 1 (certain).
P(A) = Favorable outcomes / Total outcomes
Key Concepts
Concept Definition / Formula
Sample Space (S) Set of all possible outcomes of a random experiment
Event A subset of the sample space
Complement (A') All outcomes NOT in A. P(A') = 1 - P(A)
Conditional P(A|B) Probability of A given B has occurred. P(A intersect B) / P(B)
Types of Events
Type Description P(A and B)
Joint / Non-disjoint Have common outcomes; can occur together P(A) x P(B)
Disjoint / Mutually exclusive No common outcomes; cannot occur 0
simultaneously
Independent Occurrence of one does not affect the other P(A) x P(B)
Dependent Occurrence of one affects the other P(A) x P(B|A)
Bayes' Theorem
Updates the probability of an event based on new evidence. Widely used in machine learning, spam
filters, medical diagnosis, and recommendation systems.
P(A|B) = P(B|A) x P(A) / P(B)
09 Probability Distributions
Discrete Random Variable Continuous Random Variable
Finite or countable values. Use PMF (Probability Infinite values over an interval. Use PDF (Probability
Mass Function). Represented as bar charts. Density Function). Represented as smooth curves.
Discrete Distributions
Distribution Description Mean / Variance
Bernoulli Single trial; binary outcome (0 = failure, 1 = success). Mean = p, Var =
p(1-p)
Binomial n independent Bernoulli trials. If n=1, reduces to Bernoulli Mean = np, Var =
distribution. np(1-p)
Continuous Distributions
Distribution Description Key Formula
Uniform All values equally likely over interval [a, b]. f(x) = 1/(b-a), Mean =
(a+b)/2
Normal (Gaussian) Bell-shaped, symmetric. Most common in nature. See Section 10 for full
Defined by mean and standard deviation. detail
10 Normal Distribution, Standardization & Normalization
Standard Normal Distribution (Z-Distribution)
Special case where mean = 0 and standard deviation = 1. Convert any value to a Z-score to compare
across different distributions.
z = (x - mean) / standard deviation
Z-score Meaning
z>0 Value is above the mean
z<0 Value is below the mean
z=0 Value equals the mean
Empirical Rule (68-95-99.7 Rule)
Applies only to normal (bell-shaped) distributions:
Range from mean Data Coverage
+/- 1 standard deviation 68% of all data
+/- 2 standard deviations 95% of all data
+/- 3 standard deviations 99.7% of all data
Note: Values beyond +/- 3 standard deviations (approximately 0.3% of data) are treated as outliers.
Standardization vs Normalization
Standardization (Z-score) Normalization (Min-Max Scaling)
Formula z = (x - mean) / std dev x_new = (x - x_min) / (x_max -
x_min)
Output range Unbounded (no fixed range) Always 0 to 1
Outlier sensitivity Less sensitive (uses mean and std More sensitive (uses min and max)
dev)
Use when Distribution is known to be normal Features are on different scales
Preserves distribution? Yes Not necessarily
11 Inferential Statistics & Estimation
Uses sample data to draw conclusions and make predictions about a larger population.
Population Parameters vs Sample Statistics
Measure Population symbol Sample symbol
Mean mu x-bar
Standard deviation sigma s
Size N (capital) n (lowercase)
Proportion P p-hat
Correlation coefficient rho r
Types of Estimation
Point Estimation Interval Estimation
Single best-guess value for a population parameter. A range of values likely to contain the true
Simple but provides no reliability information. parameter. More accurate and reliable than point
estimates.
Confidence Interval
Expresses how confident we are (e.g. 95%) that the true population parameter lies within the estimated
interval.
CI = Point Estimate +/- Margin of Error
Margin of Error = Critical Value x (sigma / sqrt(n))
Confidence Level Alpha (significance) Critical Value (z)
90% 0.10 1.645
95% 0.05 1.960
99% 0.01 2.576
Note: Use Z-distribution when n > 30 and population std dev is known. Use T-distribution when n <= 30 or
std dev is unknown. Degrees of freedom = n - 1.
12 Hypothesis Testing
A method to evaluate a claim about a population parameter using sample data as evidence.
Null Hypothesis (H0) Alternate Hypothesis (H1)
Default/baseline statement to test. e.g. 'No Opposite of H0. Accepted when H0 is rejected. e.g.
significant difference exists.' Symbol: H0 'A significant difference exists.' Symbol: H1
Decision Rule
Condition Decision
p-value < alpha (significance level) Reject H0 — Accept H1
p-value >= alpha Fail to reject H0
Common alpha values 0.05 (most fields), 0.01 (medical or critical
decisions)
Types of Errors
Error Type Description Also called
Type I Error (alpha) Reject H0 when it is actually TRUE False Positive
Type II Error (beta) Accept H0 when it is actually FALSE False Negative
Tail Tests
Test type Description When to use
One-tailed Alpha is entirely in one tail (left or right) Testing strictly greater than
OR less than a value
Two-tailed Alpha is split as alpha/2 in both tails Testing for any difference in
either direction
Statistical Tests — Quick Reference
Test When to use Sample size
Z-test (one or two sample) Compare sample mean to population mean; population std n > 30
dev known
Independent T-test Compare means of two independent groups; std dev n <= 30
unknown
Paired T-test Compare same group before and after a condition n <= 30
ANOVA / F-test Compare means of 3 or more groups simultaneously Any
Chi-square (independence) Test association between two categorical variables Any
Chi-square (goodness of fit) Test if observed frequencies match an expected Any
distribution
ANOVA Types
Type Description Example
One-Way ANOVA One factor variable; one response variable 3 teaching methods -->
exam scores
Two-Way ANOVA Two factor variables; one response variable Fertilizer + Planting density
--> crop yield
Note: ANOVA null hypothesis: all group means are equal (H0: u1=u2=u3). Alternate: at least one mean is
significantly different.
End of Notes — Statistics for Data Analysis & Data Science