Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Semester 2, 2016
,1 / 26
Linear regression
,2 / 26
50
100
200
300
25
5
10
15
Sales
20
25
20
15
Sales
10
15
10
5
Sales
20
25
10
TV
20
30
40
50
Radio
20
40
60
80
100
Newspaper
,3 / 26
,4 / 26
n
X
i=1
ei2
n
n
X
X
2
=
(yi yi ) =
(yi 0 1 xi )2 .
i=1
i=1
,5 / 26
15
10
5
Sales
20
25
Advertising example
50
100
150
200
250
300
TV
y = 7.03 + 0.0475x
,6 / 26
Advertising example
3
0.05
2.15
0.04
0.06
2.5
2.2
0.03
2.3
3
5
3
6
,7 / 26
,8 / 26
10
5
10
Y
10
10
,9 / 26
SE(0 ) =
+ Pn
n
)2
i=1 (xi x
and
,
)2
i=1 (xi x
SE(1 ) = pPn
where =
p
V ().
,10 / 26
Hypothesis testing
If 1 = 0, then the simple linear model reduces to Y = 0 + ,
and X is not associated with Y .
To test whether X is associated with Y , we perform a
hypothesis test:
H0 : 1 = 0 (there is no relationship between X and Y )
HA : 1 6= 0 (there is some relationship between X and Y )
If the null hypothesis is true (1 = 0), then
t=
1 0
SE(1 )
,11 / 26
Intercept
TV
Coefficient
7.0325
0.0475
Std. Error
0.4578
0.0027
t-statistic
15.36
17.67
p-value
<0.0001
<0.0001
,12 / 26
,13 / 26
Quantity
Residual standard error (RSE)
R2
Value
3.26
0.612
,14 / 26
,15 / 26
X2
y = 0 + 1 x1 + 2 x2 .
B. Robertson, University of Canterbury
X1
,16 / 26
n
X
(yi yi )2
i=1
n
X
i=1
,17 / 26
Intercept
TV
Radio
Newspaper
Coefficient
2.939
0.046
0.189
-0.001
Std. Error
0.3119
0.0014
0.0086
0.0059
t-statistic
9.42
32.81
21.89
-0.18
p-value
<0.0001
<0.0001
<0.0001
0.8599
,18 / 26
(TSS - RSS)/p
RSS/(n p 1)
,19 / 26
Value
1.69
0.897
570
,20 / 26
,21 / 26
Intercept
TV
Radio
TvRadio
Coefficient
6.7502
0.0191
0.0289
0.0011
Std. Error
0.248
0.002
0.009
0.000
t-statistic
27.23
12.70
3.24
20.73
p-value
<0.0001
<0.0001
0.0014
<0.0001
,22 / 26
,23 / 26
50
30
20
10
40
Linear
Degree 2
Degree 5
50
100
150
200
Horsepower
,24 / 26
Intercept
Horsepower
Horsepower2
Coefficient
56.9001
-0.4662
0.0012
Std. Error
1.8004
0.0311
0.0001
t-statistic
31.6
-15.0
10.1
p-value
<0.0001
<0.0001
<0.0001
,25 / 26
,26 / 26