Correlation & Regression
Unit IV Β· Lecture 27
π Univariate vs Bivariate vs Multivariate
Univariate
One variable measured per observation.
Examples:
Heights of 50 students
Daily temperatures for a month
Exam scores of a class
Tools: Mean, variance, histograms, frequency tables
Bivariate
Two variables measured on each observation.
Examples:
Height & weight of students
Advertising spend & sales
Study hours & exam score
Tools: Scatter diagrams, correlation, regression
Multivariate
Three or more variables per observation.
Examples:
Height, weight & age
Temperature, humidity & rainfall
Multiple exam scores per student
Tools: Multiple regression, partial correlation
π Formal Definition
Bivariate data consists of pairs of observations (xα΅’, yα΅’) for i = 1, 2, β¦, n, where two different measurements are recorded on each subject or experimental unit. The goal is to study the relationship between the two variables β how changes in one variable are associated with changes in the other.
Correlation & Regression
Unit IV Β· Lecture 27
π Bivariate Frequency Distribution
π Definition
A bivariate frequency table (or two-way table) shows the frequency of occurrence of each combination of values for two variables. Each cell shows how many observations fall into that particular (x-class, y-class) combination.
π Example: Height (cm) vs Weight (kg) of 40 Students
| Height β \ Weight β | 40β50 | 50β60 | 60β70 | 70β80 | Total |
| (yβ) | (yβ) | (yβ) | (yβ) | |
| 150β160 (xβ) | 4 | 3 | 1 | 0 | 8 |
| 160β170 (xβ) | 2 | 6 | 5 | 1 | 14 |
| 170β180 (xβ) | 0 | 3 | 7 | 4 | 14 |
| 180β190 (xβ) | 0 | 0 | 2 | 2 | 4 |
| Total | 6 | 12 | 15 | 7 | 40 |
π Marginal Distributions
The row totals give the marginal distribution of height (x): 8, 14, 14, 4.
The column totals give the marginal distribution of weight (y): 6, 12, 15, 7.
These are just the univariate distributions of each variable separately.
π Reading the Pattern
The high-frequency cells (6, 7, 5) cluster along the diagonal from top-left to bottom-right. This indicates a positive association β taller students tend to weigh more.
If the high frequencies were along the opposite diagonal, it would indicate a negative association.
Correlation & Regression
Unit IV Β· Lecture 27
π΅ Scatter Diagram β Definition
π Formal Definition
A scatter diagram (or scatter plot) is a graphical representation of bivariate data where each observation (xα΅’, yα΅’) is plotted as a point on a two-dimensional coordinate system. The horizontal axis (x-axis) represents one variable and the vertical axis (y-axis) represents the other.
π‘ Why Scatter Diagrams Matter
A scatter diagram is the first thing you should draw when analysing bivariate data. Before computing any correlation coefficient or fitting any regression line, look at the scatter plot. It reveals the shape, direction, strength, and outliers of the relationship β information that summary statistics alone cannot fully capture. Anscombe's Quartet (coming up) proves this dramatically.
π How to Construct
Step 1: Identify the two variables. Choose which is x (horizontal) and which is y (vertical). Convention: x = independent/explanatory, y = dependent/response.
Step 2: Draw axes with appropriate scales. Include labels and units.
Step 3: Plot each (xα΅’, yα΅’) pair as a dot on the graph.
Step 4: Look for patterns β direction, form, strength, outliers.
π What to Look For
Direction: Positive (upward trend) or negative (downward trend)?
Form: Linear (straight line), curved, or no pattern?
Strength: How tightly do points cluster around a pattern?
Outliers: Any points far from the main cluster?
Clusters: Are there distinct groups in the data?
Correlation & Regression
Unit IV Β· Lecture 27
π Anscombe's Quartet β Why Always Plot First!
π Anscombe's Quartet (1973)
Statistician Francis Anscombe created four datasets that have identical summary statistics (same mean of x, mean of y, variance of x, variance of y, correlation r = 0.816, and same regression line) β but look completely different when plotted. This proves that you must always visualise your data before computing statistics.
Dataset I
Linear relationship. Classic scatter. The regression line fits well.
Dataset II
Curvilinear pattern. A straight line is NOT the right model here.
Dataset III
One outlier pulls the line. Without it, r would be 1.0.
Dataset IV
All x's are the same except one. One point controls everything.
π¬ Lesson: All four datasets have r = 0.816, the same regression line Ε· = 3 + 0.5x, and the same RΒ² = 0.67. But only Dataset I actually fits a linear model well. Always plot your data first!
Correlation & Regression
Unit IV Β· Lecture 27
βοΈ Independent vs Dependent Variable
π Independent Variable (x)
The variable that is controlled, manipulated, or used to predict. Also called the explanatory variable, predictor variable, or regressor.
Placed on the horizontal axis of a scatter plot.
Example: Study hours, advertising spend, temperature, height.
π Dependent Variable (y)
The variable whose value depends on or is predicted by the independent variable. Also called the response variable, outcome variable, or regressand.
Placed on the vertical axis of a scatter plot.
Example: Exam score, sales, ice cream sales, weight.
π¬ Caution: In correlation, it does not matter which variable is x and which is y β correlation is symmetric (r(x,y) = r(y,x)). In regression, it matters greatly β the regression line of y on x is different from the regression line of x on y. We will explore this in Lectures 31β32.
π‘ Correlation β Causation
Finding a strong correlation between two variables does not mean one causes the other. Ice cream sales and drowning deaths are positively correlated β but ice cream doesn't cause drowning. Both are caused by a third variable (hot weather). Always consider confounding factors and the possibility of coincidence.
Correlation & Regression
Unit IV Β· Lecture 27
π§ Quick Quiz β Lecture 27
Q1: Bivariate data involves measuring:
A) One variable on each unit
B) Two variables on each unit
C) Three or more variables
D) One variable on two units
Q2: In a scatter diagram, the independent variable is placed on:
A) The horizontal (x) axis
B) The vertical (y) axis
C) Either axis β it doesn't matter
D) Neither axis
Q3: If points in a scatter plot cluster tightly around a line sloping upward from left to right, this indicates:
A) Strong negative correlation
B) Strong positive correlation
C) No correlation
D) Curvilinear correlation
Q4: Anscombe's Quartet demonstrates that:
A) Correlation always implies causation
B) Identical statistics can describe very different data patterns
C) Scatter plots are unnecessary
D) Regression is always linear
Q5: "Correlation does not imply causation" means:
A) Correlation is useless
B) A statistical association does not prove one variable causes the other
C) Only experiments can show correlation
D) Correlation and causation are the same thing
Q6: The row totals in a bivariate frequency table give:
A) The joint distribution
B) The marginal distribution of the row variable
C) The conditional distribution
D) The correlation coefficient
Correlation & Regression
Unit IV Β· Lecture 27
π Homework & Next Lecture
π Practice Tasks
1. The following data gives marks in Statistics (x) and marks in Mathematics (y) for 8 students. Draw a scatter diagram and describe the pattern.
x: 30, 35, 40, 45, 50, 55, 60, 65
y: 32, 38, 42, 48, 50, 54, 58, 62
2. Construct a bivariate frequency table for the following data on hours of TV watched (x) and GPA (y) for 20 students. Use classes for both variables.
3. For each scatter pattern below, state whether Pearson's r would be close to +1, β1, 0, or misleading:
(a) Perfect upward line (b) U-shaped curve (c) Random cloud (d) Downward line with one outlier
4. Explain why a scatter diagram should always be drawn before computing a correlation coefficient.
5. BONUS: Look up Anscombe's Quartet data online. Compute the mean and variance of x and y for all four datasets and verify they are identical.
Upcoming
Lecture 28: Karl Pearson's Coefficient of Correlation β the most widely used measure of linear association.