Correlation Regression 1
Correlation Regression 1
10
8
6
4
1 3 5 7 9
Advertising ($100)
• Sometimes two variables are related to each
other.
• The values of both of the variables are paired.
• Change in the value is reflected in the change of
the value of other.
• Usually these two variables are two attributes of
each member of the population
• For Example:
Height Weight
Advertising Expenditure Sales Volume
Unemployment Crime Rate
Rainfall Food Production
Expenditure Savings
Scatter Plots
X
Positively Correlated Negatively Correlated
Y Y
X X
Y Y
X X
Types of Relationships
Y Y
X X
Y Y
X X
Types of Relationships
No relationship
X
Simple Linear Regression Analysis
• The simplest mathematical relationship is
• Y = a + bX + error (linear)
• Changes in Y are related to the changes in X
• What are the most suitable values of
a (intercept) and b (slope)?
Y b
1
y = a + b.x
}a
X
Method of Least Squares
Y
(xi,yi)
ERROR
xi X
The best fitted line would be for which all the ERRORS
are minimum.
Least Squares Procedure
YouTube Views Vs Guitar Sales
YouTube Guitar
Views Sales
(1,000s)
30 8
40 11
70 12
60 10
80 15
50 13
12
10
6
20 30 40 50 60 70 80 90
YouTube Views (1,000s)
• Yi is dependent variable
•X1, X2, …, Xk are independent variables.
•β0, β1, β2, …, βk are regression coefficients
•We estimate unknown regression
coefficients β0, β1, β2, …, βk using the
observed data.
• Example:
• A distributor of frozen dessert pies wants to
evaluate factors which influence the demand
• Dependent variable:
• Pie sales (units per week)
• Independent variables:
• Price (in $)
• Advertising Expenditure ($100’s)
• Data collected for 15 weeks
Pie Price Advertising
Week Sales ($) ($100s) Coefficients
1 350 5.50 3.3 Intercept 306.5261933
2 460 7.50 3.3 Price ($) -24.97508952
3 350 8.00 3.0 Adv ($100s) 74.13095749
4 430 8.00 4.5
5 350 6.80 3.0 Multiple regression equation:
6 380 7.50 4.0
Sales = b0 +b1X1 + b2X2
7 430 4.50 3.0
8 470 6.40 3.7 Where X1 = Price
9 450 7.00 3.5 X2 = Advertising
10 490 5.00 4.0
11 340 7.20 3.5
Sales = 306.53 – 24.98 X1 + 74.13X2
12 300 7.90 3.2
13 440 5.90 4.0
14 450 5.00 3.5
15 300 7.00 2.7
Sales 306.53 - 24.98(X1 ) 74.13(X2 )