Professional Documents
Culture Documents
Applied Statistics
Week 9
SIMPLE LINEAR REGRESSION AND
CORRELATION
REFERENCE
1.1 Definition
Variable Variable
1 2
y y
x x
y y
x x
Bina Nusantara University 6
Correlation Analysis
No relationship x
x
Bina Nusantara University 7
Correlation Analysis
x x x
r = -1 r = -0.6 r=0
y y
x x
r = +0.3 r = +1
( x x )( y
i i y)
rxy i 1
n n
2
( xi x ) ( yi y )
2
i 1 i 1
r = Sample correlation coefficient
n = Sample size
x = first variable
y = second variable
Bina Nusantara University 11
Correlation Analysis
Testing a Correlation
Hypothesis Test Statistic Critical Values
H 0: ³ o
t t ,n 2
H 1: < o
r n2
H 0 : £ o t
1 r2 t t ,n 2
H 1 : > o
H 0: = o t t / 2,n 2 or
t t / 2,n 2
H 1: ¹ o
Bina Nusantara University 12
Correlation Analysis
Example 1
Example 1
Example 1
( x x )( y y )
i i
rxy i 1
n 2
n
2
( xi x ) ( yi y )
i 1 i 1
2840
rxy 0,95
(568)(15730)
Bina Nusantara University 15
The Simple Linear Regression
Model
Independent Dependent
variable variable
Dependent variable:
The variable we wish to explain
Independent variable:
The variable used to explain the dependent variable
Independent Dependent
variable variable
Linear regression is
Example 2
Example 2
Model :
Predict : 201.7
Impact : Yes
Where
x = independent variable
y = dependent variable
n = number of data
Population Random
Population Independent Error
Slope
Dependent y intercept Variable term, or
Coefficient
Variable residual
y β 0 β1x ε
Linear component Random Error
component
Bina Nusantara University 24
The Simple Linear Regression
Model
y y
x x
Linear relationships Nonlinear relationships
y y
x x
Bina Nusantara University 26
The Simple Linear Regression
Model
y β 0 β1x ε
Bina Nusantara University 27
The Simple Linear Regression
Model
Independent
ˆ ˆ
ŷ 0 1x variable
S xy x i x yi y
ˆ1 i 1
n
S xx
x x
2
i
i 1
ˆo y ˆ1 x
Estimation of variance
n
y yˆ i
2
i
ˆ
2 i 1
n2
Coefficient Determination
2
R , the coefficient of determination of the regression
line is defined as the proportion of the total sample
variability in the Y ’s explained by the regression model
R r 2 2
xy
R rxy
Bina Nusantara University 31
The Simple Linear Regression
Model
Example 3
Scatterplot
Example 3
Example 3
n
x i x yi y
2840
ˆ1 i 1
n
5
568
ix x 2
i 1
yˆ 60 5 x
Bina Nusantara University 35
The Simple Linear Regression
Model
Example 3
yˆ 60 5 x
Hypothesis Test :
β1 = 0
β1 ≠ 0
Statistical test :
ˆ1
t
ˆ / S xx
Critical value :
t t / 2,n 2
Example 4
t t t 2,308
Critical value : 5% / 2 ,8
Conclusion : Reject H0
Bina Nusantara University 39
Inference on the Parameter
Confidence
Interval for
the mean of
y, given xp
x
x xp
Bina Nusantara University 42
The Analysis of Variance Table
- Hypothesis :
H 0 : 1 0
H 1 : 1 0
- Test statistics :
ANOVA Table
n
SST yi y
2
i 1
n
SSE yi yˆ i
2
i 1
n
SSR yˆ i y
2
i 1
Example 5