This document discusses linear regression analysis. It defines the equation of a linear regression line as ŷ = mx + b, where m is the slope and b is the y-intercept. The document provides the steps to compute the regression line from a dataset, including calculating the correlation coefficient, slope, y-intercept, and using the line to predict values and calculate errors. It works through an example dataset, computing the regression line and making predictions.
Introduction to Linear Regression, emphasizing the equation of a straight line (y = mx + b). Explains components - slope (m) and y-intercept (b).
Introduction of regression line equation (ŷ = mx + b) and calculating slope (m) along with y values. Discusses data observations.
Tasks for data analysis including scatter plot, Pearson’s correlation coefficient (r ≈ 0.92, strong positive correlation), and finding regression line equation.
Deriving regression line equation (ŷ = 0.57x + 1.07), making predictions for x=14 (ŷ=9.05) and x=8 (ŷ=5.63), and calculating prediction error for x=10.
The Equation ofa Regression Line
ŷ = mx + b
ŷ : the predicted y-value for a given x-value
m : the slope of the line
b : the y-intercept
Obs. x i y j
1 x 1 y 1
2 x 2 y 2
3 x 3 y 3
… … …
… … …
… … …
… … …
… … …
n x n y n
Sum
7.
ŷ = mx+ b
m =
𝑛 𝑥𝑦 −( 𝑥)( 𝑦)
𝑛 𝑥2
−( 𝑥)2
𝑦 = m𝑥 + b
b = 𝑦 - m𝑥 where:
𝑥 : the mean of the x values.
𝑦 : the mean of the y values.
b =
𝑦
𝑛
- 𝑚
𝑥
𝑛
b =
𝑦 −𝑚 𝑥
𝑛
Obs. x i y j
1 x 1 y 1
2 x 2 y 2
3 x 3 y 3
… … …
… … …
… … …
… … …
… … …
n x n y n
Sum
8.
For the followingdata:
1- Display the Scatter Plot.
2- Compute the Pearson’s Correlation Coefficient.
3- Find the Equation of the Regression Line.
4- Draw the Regression Line.
5- Predict the value of ŷ for x=14 and x=8
6- Compute the Error of Prediction for x=10
Obs. x y
1 1 1
2 2 3
3 3 2
4 3 3
5 5 3
6 5 5
7 7 4
8 7 7
9 9 7
10 10 5
11 11 7
12 11 8
13 13 8
14 13 9
5- Predict thevalue of ŷ for x=14 and x=8
For x=14 (Extrapolation)
ŷ = 0.57 x + 1.07
ŷ = (0.57)(14) + 1.07
ŷ = 9.05
For x=8 (Interpolation)
ŷ = 0.57 x + 1.07
ŷ = (0.57)(8) + 1.07
ŷ = 5.63
15.
Predicted Value ŷ
ŷ= 0.57 x + 1.07
For x=10
ŷ = (0.57)(10) + 1.07 = 6.77
Actual Value = 5
Error of Prediction = Predicted Value – Actual Value
Error of Prediction = 6.77 – 5 = 1.77
6- Compute the Error of Prediction for x=10