Chương 1, phần A
Hồi quy tuyến tính đơn
Mô hình hồi quy tuyến tính đơn
- Simple Linear Regression Model
Phương pháp bình phương tối thiểu
- Least Squares Method
Hệ số xác định –
Coefficient of Determination
Các giả định của mô hình –
Model Assumptions
Kiểm định ý nghĩa –
Testing for Significance
1
Simple Linear Regression
Những quyết định quản trị thường dựa vào quan hệ
giữa hai hay nhiều biến
Phân tích hồi quy có thể được dùng để xây dựng một
phương trình toán học cho thấy liên hệ giữa các biến
Biến được tìm hiểu hay cần dự đoán gọi là biến phụ
thuộc, được ký hiệu là y
Các biến được sử dụng để giải thích hay dự đoán
biến phụ thuộc gọi là biến độc lập, ký hiệu là x
2
Simple Linear Regression
Simple linear regression liên quan đến một biến
độc lập và một biến phụ thuộc.
Mối quan hệ giữa hai biến được biểu diễn như một
đường thẳng
Hàm hồi quy gồm hai hay nhiều biến độc lập gọi là
multiple regression.
3
Simple Linear Regression Model
Hàm biểu diễn quan hệ giữa y với x và sai số gọi là
regression model.
The simple linear regression model is:
y = b0 + b1x +e
Trong đó:
b0 và b1 gọi là tham số của mô hình,
e là biến ngẫu nhiên gọi là sai số
4
Simple Linear Regression Equation
The simple linear regression equation is:
E(y) = b0 + b1x
• Đồ thị có dạng đường thẳng
• b0 là hệ số gốc - the y intercept of the regression line.
• b1 là hệ số độ dốc - the slope of the regression line.
• E(y) là giá trị kỳ vọng của y tương ứng với một giá
trị cho trước của x.
5
Simple Linear Regression Equation
Positive Linear Relationship
E(y)
Regression line
Intercept
b0
Slope b1
is positive
x
6
Simple Linear Regression Equation
Negative Linear Relationship
E(y)
Intercept
b0
Regression line
Slope b1
is negative
x
7
Simple Linear Regression Equation
No Relationship
E(y)
Intercept
b0
Regression line
Slope b1
is 0
x
8
Estimated Simple Linear Regression Equation
The estimated simple linear regression equation
???? = ????0 + ????1 ????
• Đồ thị gọi là đường hồi quy ước lượng.
• b0 is the y intercept of the line.
• b1 is the slope of the line.
• ???? là giá trị ước lượng của y với giá trị cho trước của x
9
Estimation Process
Regression Model
y = b0 + b1x +e
Regression Equation
E(y) = b0 + b1x
Unknown Parameters
b0, b1
b0 and b1
provide estimates of
b0 and b1
Sample
x
y
x1
y1
.
.
.
.
xn yn
Estimated
Regression Equation
???? = ????0 + ????1 ????
Sample Statistics
b 0, b 1
10
Least Squares Method
Least Squares Criterion
min (???????? − ???????? )2
Trong đó:
yi = giá trị quan sát của biến phụ thuộc của quan sát thứ i
???????? = giá trị ước lượng của biến phụ thuộc của quan sát thứ i.
11
Least Squares Method
Slope for the Estimated Regression Equation
????1 =
???????? − ???? ???????? − ????
???????? − ???? 2
Trong đó:
xi = giá trị của biến độc lập của quan sát thứ i
yi = giá trị của biến phụ thuộc của quan sát thứ i
???? = giá trị trung bình của biến độc lập
???? = giá trị trung bình của biến phụ thuộc
12
Least Squares Method
y-Intercept for the Estimated Regression Equation
????0 = ???? − ????1 ????
13
Simple Linear Regression
Example: Reed Auto Sales
Reed Auto periodically has a special week-long sale.
As part of the advertising campaign Reed runs one or
more television commercials during the weekend
preceding the sale. Data from a sample of 5 previous
sales are shown on the next slide.
14
Simple Linear Regression
Example: Reed Auto Sales
Number of
Number of
TV Ads (x) Cars Sold (y)
1
14
3
24
2
18
1
17
3
27
Sx = 10
????=2
Sy = 100
???? = 20
15
Estimated Regression Equation
Slope for the Estimated Regression Equation
????1 =
???????? − ???? ???????? − ????
20
=
=5
2
???????? − ????
4
y-Intercept for the Estimated Regression Equation
????0 = ???? − ????1 ???? = 20 − 5 2 = 10
Estimated Regression Equation
???? = 10 + 5????
16
Estimated Regression Equation
Excel Worksheet (showing data)
1
2
3
4
5
6
7
A
Week
1
2
3
4
5
B
TV Ads
1
3
2
1
3
C
Cars Sold
14
24
18
17
27
D
17
Using Excel’s Chart Tools for
Scatter Diagram &amp Estimated Regression Equation
Producing a Scatter Diagram
Step 1 cells B2:C6
Step 2 Click the tab on the Ribbon
Step 3 In the Charts group, click Scatter (X,Y)
Step 4 When the list of scatter diagram subtypes appears,
Click Scatter (chart in upper left corner)
18
Using Excel’s Chart Tools for
Scatter Diagram &amp Estimated Regression Equation
Editing a Scatter Diagram
Step 1 Click the Chart Title and replace it with
Reed Auto Sales Estimated Regression Line
Step 2 Click the Chart Elements button
Step 3 When the list of chart elements appears:
Click Axis Titles (s placeholders for
titles)
Click Gridlines (to de gridlines option)
Click Trendline
19
Using Excel’s Chart Tools for
Scatter Diagram &amp Estimated Regression Equation
Editing a Scatter Diagram (continued)
Step 4 Click the Horizontal (Category) Axis Title and
replace it with TV Ads
Step 5 Click the Vertical (Value) Axis Title and
replace it with Cars Sold
Step 6 the Format Trendline option
Step 7 When the Format Trendline dialog box appears:
Display equation on chart
Click the Fill &amp Line button
In the Dash type box, Solid
Close the Format Trendline dialog box
20
Using Excel’s Chart Tools for
Scatter Diagram &amp Estimated Regression Equation
Reed Auto Sales Estimated Regression Line
30
Cars Sold
25
20
y = 5x + 10
15
10
5
0
0
1
2
TV Ads
3
4
21
Coefficient of Determination
Mối quan hệ giữa SST, SSR, SSE
SST
???????? − ???? 2 =
=
SSR
+
???????? − ???? 2 +
SSE
???????? − ???????? 2
Trong đó:
SST = total sum of squares
SSR = sum of squares due to regression
SSE = sum of squares due to error
22
Coefficient of Determination
The coefficient of determination is:
r2 = SSR/SST
Trong đó:
SSR = sum of squares due to regression
SST = total sum of squares
23
Coefficient of Determination
r2 = SSR/SST = 100/114 = .8772
The regression relationship is very strong 87.72%
of the variability in the number of cars sold can be
explained by the linear relationship between the
number of TV ads and the number of
...
.../2 là giá trị tra bảng trong phân phối t
với bậc tự do n-2
47
Ước lượng điểm
Nếu chạy 3 quảng cáo tv, số xe bán được trung bình là:
???? = 10 + 5 3 = 25 xe
48
Dự báo giá trị trung bình
Ước lượng độ lệch chuẩn của ???? ∗
1
????∗ − ???? 2
???????? ∗ = ????
+
????
???????? − ???? 2
1
3−2 2
????????∗ = 2.16025
+
5
1 − 2 2 + 3 − 2 2 + ⋯+ 3 − 2 2
1 1
????????∗ = 2.16025
+ = 1.4491
5 4
49
Dự báo giá trị trung bình
Dự báo giá trị trung bình của số xe bán ra khi có 3
quảng cáo tv là:
???? ∗ ± ????????/2 ???????? ∗
25 + 3.1824(1.4491)
25 + 4.61
20.39 to 29.61 xe
50
Dự báo giá trị cá biệt
Ước lượng độ lệch chuẩn của một
giá trị cá biệt của y*
1
????∗ − ???? 2
???????????????????? = ???? 1 + +
????
???????? − ???? 2
1 1
???????????????????? = 2.16025 1 + +
5 4
spred = 2.16025(1.20416) = 2.6013
51
Dự báo giá trị cá biệt
Dự báo giá trị cá biệt cho số xe được bán ra khi có 3
quảng cáo tv ở độ tin cậy 95% là:
???? ∗ ± ????????/2 ????????????????????
25 + 3.1824(2.6013)
25 + 8.28
16.72 to 33.28 xe
52
Using Excel’s Regression Tool
Excel Worksheet (showing data)
1
2
3
4
5
6
7
A
Week
1
2
3
4
5
B
TV Ads
1
3
2
1
3
C
Cars Sold
14
24
18
17
27
D
53
Using Excel’s Regression Tool
Performing the Regression Analysis
Step 1 Click the DATA tab on the ribbon
Step 2 In the Analysis group, click Data Analysis
Step 3 Choose Regression from the list of
Analysis Tools
continued
54
Using Excel’s Regression Tool
Performing the Regression Analysis
Step 4 When the Regression dialog box appears:
Enter C1:C6 in the Input Y Range box
Enter B1:B6 in the Input X Range box
Labels
Confidence Level
Enter 95 in the Confidence Level box
Output Range
Enter A8 in the Output Range box
Click OK
55
Using Excel’s Regression Tool
Excel Value Worksheet
A
B
C
D
E
F
G
H
I
1
Week
TV Ads
Cars Sold
2
1
1
14
3
2
3
24
4
3
2
18
5
4
1
17
6
5
3
27
7
8 SUMMARY OUTPUT
9
10
Regression Statistics
11 Multiple R
0.936585812
12 R Square
0.877192982
13 Adjusted R Square
0.83625731
14 Standard Error
2.160246899
15 Observations
5
16
17 ANOVA
18
df
SS
MS
F
Significance F
19 Regression
1
100
100 21.42857 0.018986231
20 Residual
3
14 4.666667
21 Total
4
114
22
23
Coefficients Standard Error t Stat
P-value
Lower 95% Upper 95% Lower 95.0% Upper 95.0%
24 Intercept
10
2.366431913 4.225771 0.024236 2.468950436 17.53104956 2.468950436 17.53104956
25 TV Ads
5
1.08012345 4.6291 0.018986 1.562561893 8.437438107 1.562561893 8.437438107
26
Data
Regression Statistics Output
ANOVA Output
Estimated Regression
Equation Output
56
Using Excel’s Regression Tool
Excel Value Worksheet (bottom-left portion)
A
B
C
D
E
22
23
Coeffic. Std. Err. t Stat P-value
24 Intercept
10 2.36643 4.2258 0.02424
25 TV Ads
5 1.08012 4.6291 0.01899
26
Note: Columns F-I are not shown.
57
Using Excel’s Regression Tool
Excel Value Worksheet (bottom-right portion)
A
B
F
G
H
I
22
23
Coeffic. Low. 95% Up. 95% Low. 95.0% Up. 95.0%
24 Intercept
10 2.46895 17.53105 2.46895044 17.5310496
25 TV Ads
5 1.562562 8.437438 1.56256189 8