Upload
naneei
View
237
Download
3
Embed Size (px)
Citation preview
8/4/2019 Chapter 8 Simple Linear Regression
1/39
1
8/4/2019 Chapter 8 Simple Linear Regression
2/39
CHAPTER 8
Draw a scatter plot/diagram to see relationship
between two variables.
Understand and interpret the terms dependentvariable and independentvariable.
Find linear regression model and make predictions.
Study on the strength of the relationship called
correlation analysis.
2
8/4/2019 Chapter 8 Simple Linear Regression
3/39
3
8/4/2019 Chapter 8 Simple Linear Regression
4/39
In a simple linear relationship, only TWO variablesare involved:
X = independent variable
Y = dependent variable
CHAPTER 8
4
8/4/2019 Chapter 8 Simple Linear Regression
5/39
Examples:
1. A sociologist wants to find out if increase in crime
rate is due to increase in cost of living.X = cost of livingY = crime rate
2. A fitness instructor wants to find out the relationshipbetween weight loss and the amount of workout time.X = amount of workout timeY = weight
CHAPTER 8
5
8/4/2019 Chapter 8 Simple Linear Regression
6/39
6
8/4/2019 Chapter 8 Simple Linear Regression
7/39
A plot between the pairs (x, y) values.
To examine relationship between two variables, X
and Y.
Gives general idea whether X is related to Y.
Plots that give a certain pattern means there is arelationship between X and Y.
Plots that have no particular pattern means there isno relationship between X and Y.
CHAPTER 8
7
8/4/2019 Chapter 8 Simple Linear Regression
8/39
Increasing pattern. As X increases, Y also increases.
Positive linear relationship between X and Y.
CHAPTER 8
8
8/4/2019 Chapter 8 Simple Linear Regression
9/39
Decreasing pattern. As X increases, Y decreases.
Negative linear relationship between X and Y.
CHAPTER 8
9
8/4/2019 Chapter 8 Simple Linear Regression
10/39
No particular pattern.
No relationship between X and Y.
CHAPTER 8
10
8/4/2019 Chapter 8 Simple Linear Regression
11/39
CHAPTER 8
Question:
You are a marketing analyst for Hasbro Toys. You gather
the following data:
Sketch a scatter plot of the data above. 11
Ad (RM) Sales (Units)
1 1
2 1
3 24 2
5 4
8/4/2019 Chapter 8 Simple Linear Regression
12/39
CHAPTER 8
Answer:
1. Is X and Y
related?
2. Positive or
Negative
Relationship?
12
01234
0 1 2 3 4 5
Sales, Y
Advertising, X
8/4/2019 Chapter 8 Simple Linear Regression
13/3913
8/4/2019 Chapter 8 Simple Linear Regression
14/39
A mathematical equation that describes the linearrelationship between X and Y.
Can be used to predict the values of Y from knownvalues of X.
Represents a straight line, so it is of the form y=mx + c,where m is the slope and c is the y-intercept.
CHAPTER 8
14
8/4/2019 Chapter 8 Simple Linear Regression
15/39
In statistical regression, we write the linear model as
Y = + X +
where = y-intercept
= slope = random error component
CHAPTER 8
15
8/4/2019 Chapter 8 Simple Linear Regression
16/39
This regression line is usually estimated by using the
paired sample data. The estimated regression line isgiven by
wherea = estimated b = estimated
CHAPTER 8
16
bXaY '
8/4/2019 Chapter 8 Simple Linear Regression
17/39
The method used to find the values ofa and b is
slightly different from the familiar method youlearned in algebra.
Uses the concept of Least-Square Method.
CHAPTER 8
17
8/4/2019 Chapter 8 Simple Linear Regression
18/39
Formula to estimate a and b:
Now we can fit the regression line to the data usingthe values ofa and b. The estimated regression line is
CHAPTER 8
18
bn XY X Y
n X X
aY
nb
X
n
( ) ( )( )
( ) ( )
2 2
bXaY '
8/4/2019 Chapter 8 Simple Linear Regression
19/39
CHAPTER 8
Question:
You are an economist for the county cooperative. You
gather the following data.
Find the estimated regression line relating crop yield and
fertilizer.
19
Fertilizer (lb.) Yield (lb.)4 3.0
6 5.5
10 6.5
12 9.0
8/4/2019 Chapter 8 Simple Linear Regression
20/39
CHAPTER 8
Answer:
Construct this table first.
Total:
Mean: 8 6
20
X Y X XY
4 3.0 16 12
6 5.5 36 33
10 6.5 100 65
12 9.0 144 108
32 24.0 296 218
8/4/2019 Chapter 8 Simple Linear Regression
21/39
CHAPTER 8
Answer:
Using values from the table, estimate a and b.
Therefore, the estimated regression line is
21
65.0)32()296(4
)24)(32()218(42
b
8.0)8(65.06 a
XY 65.08.0'
8/4/2019 Chapter 8 Simple Linear Regression
22/39
CHAPTER 8
Answer:
22
0246810
0 5 10 15
Yield (Y)
Fertilizer (X)
.8 .65y x
8/4/2019 Chapter 8 Simple Linear Regression
23/39
CHAPTER 8
Answer:
What do a andb in the regression line means?
1. Y-intercept, a = 0.8Average Crop Yield (Y) is expected to be 0.8 lb. when
no Fertilizer (X) is used. X = 0, Y = 0.8
2. Slope, b = 0.65 Crop Yield (Y) is expected to increase by 0.65 lb. for
each 1 lb. increase in Fertilizer (X).
23
8/4/2019 Chapter 8 Simple Linear Regression
24/39
CHAPTER 8
Question:
A student wants to know the relationship between
number of pages and the price of the book. To analyze
this, he selects a sample of 8 textbooks currently on salein a bookstore.
Develop a regression line to fit the data given.
24
8/4/2019 Chapter 8 Simple Linear Regression
25/39
CHAPTER 8
Question:
25
Book No. of Pages (X) Price (Y)
History 500 84
Algebra 700 75
Geometry 800 99
Physics 600 72
Sociology 400 69Biology 500 81
Statistics 600 63
Nursing 800 93
8/4/2019 Chapter 8 Simple Linear Regression
26/39
CHAPTER 8
Answer: Construct this table first.
Total: 4900 636 3150,000 397,200
Mean: 612.5 79.526
X Y X XY
500 84 250,000 42000
700 75 490,000 52500800 99 640,000 79200
600 72 360,000 43200
400 69 160,000 27600
500 81 250,000 40500600 63 360,000 37800
800 93 640,000 74400
8/4/2019 Chapter 8 Simple Linear Regression
27/39
CHAPTER 8
Answer:
Using values from the table, estimate a and b.
Therefore, the estimated regression line is
27
0514.0)4900()3150000(8
)636)(4900()397200(8 2
b
48)5.612(0514.05.79 a
XY 0514.048'
8/4/2019 Chapter 8 Simple Linear Regression
28/39
Now, that we have estimated the regression line, we
can predict Y given any values of X.
This can be found by substituting X into the estimatedregression line,
However, the value of X to insert in the equation must
be within the range of X in the data set.
CHAPTER 8
28
bXaY '
8/4/2019 Chapter 8 Simple Linear Regression
29/39
For Example 3, predict the price of the book that has
550 pages.
Thus, if the book is 550 page thick, the price isestimated to be RM76.27
REMEMBER! To predict Y , X must have values within the data set
range.
CHAPTER 8
29
27.76)550(0514.048' Y
8/4/2019 Chapter 8 Simple Linear Regression
30/39
30
8/4/2019 Chapter 8 Simple Linear Regression
31/39
Correlation measures the strength of a linearrelationship between two variables.(strong? weak?)
Correlation coefficient tells us about thestrength and direction of a relationship.
CHAPTER 8
31
8/4/2019 Chapter 8 Simple Linear Regression
32/39
A numerical measure for correlation of thequantitative data is the Pearson correlationcoefficient, r.
The formula is given by
CHAPTER 8
32
]][)()([))(()(
2222 YYnXXn
YXXYnr
8/4/2019 Chapter 8 Simple Linear Regression
33/39
0 r 1
Values ofrclose to 1strong positive linear
relationship between X and Y.
Values ofrclose to -1strong negative linear
relationship between X and Y. Values ofrclose to 0 little or no linear relationship
between X and Y.
CHAPTER 8
33
8/4/2019 Chapter 8 Simple Linear Regression
34/39
CHAPTER 8
Question:
A food analyst wants to know how much a person would
spend on food, given certain amount of income. He
selects a random sample of 7 people with their incomeand food expenditure as shown below.
34
Income
(RM 00)
35 49 21 39 15 28 25
Food Expend.
(RM 00)
9 15 7 11 5 8 9
8/4/2019 Chapter 8 Simple Linear Regression
35/39
CHAPTER 8
Question:
(i) Find the estimated regression line for the data.
(ii) How much would a person spend on food if his
income is RM 3000?
(iii) Compute Pearson correlation coefficient, r. Interpretthe r value.
35
8/4/2019 Chapter 8 Simple Linear Regression
36/39
CHAPTER 8
Answer: Construct this table first.
Total: 212 64 7222 646 2150
Mean: 30.2857 9.1429 36
Income, X Food Exp,
Y
X Y XY
35 9 1225 81 31549 15 2401 225 735
21 7 441 49 147
39 11 1521 121 429
15 5 225 25 7528 8 784 64 224
25 9 625 81 225
8/4/2019 Chapter 8 Simple Linear Regression
37/39
CHAPTER 8
Answer:
(i) Therefore, the estimated regression line is
The slope, b = 0.2642 means the relationship is
positive. That is, people with higher income will
spend more on food.
37
2642.0)212()7222(7
)64)(212()2150(72
b
1414.1)2857.30(2642.01429.9 a
XY 2642.01414.1'
8/4/2019 Chapter 8 Simple Linear Regression
38/39
CHAPTER 8
Answer:
(ii) If income is RM3000, that is X=30, then food
expenditure is
So we expect him to spend RM906.74 on food if his
income is RM3000.
38
0674.9)30(2642.01414.1' Y
8/4/2019 Chapter 8 Simple Linear Regression
39/39
CHAPTER 8
Answer:
(iii) Pearson correlation coefficient, r
The value r = 0.9587 shows a very strong positiverelationship between income and food expenditure.
When income is high, thefood expenditure also
increases.
9587.0
]646467][)212()7222(7[)64)(212()2150(7
22
r