chapter 3
chapter 3
Multiple Linear
Regression
.3.1. Method of Ordinary Least Squares revised
3.1.1 Generalising the Simple Model to Multiple Linear Regression
• Before, we have used the model
yt xt ut t = 1,2,...,T
• But what if our dependent (y) variable depends on more than one independent variable?
For example the number of cars sold might plausibly depend on
1. the price of cars
2. the price of public transport
3. the price of petrol
4. the extent of the public’s concern about global warming
• Similarly, stock returns might depend on several factors.
• Having just one independent variable is no good in this case - we want to have more than one x
variable.
Con’d
• Now we write, more than one predictor…
Yi β 0 β1 X1i β 2 X 2i β k X ki ε i
Con’d
ˆ b b X b X b X
Yi 0 1 1i 2 2i k ki
Example: 2 Independent Variables
• A distributor of icecream wants to evaluate factors thought to
influence demand
• 0 ≤ R2 ≤ 1
• R 2 so 0 ≤ R ≤ 1 (i.e., it can’t be negative)
R
• The larger their values, the better the set of explanatory variables predict
y
• R2 = 1 when observed y = predicted y, so SSE = 0
• R2 = 0 when all predicted y = y so TSS = SSE.
When this happens, b1 = b2 = … = bk = 0 and the correlation r = 0 between
y and each x predictor.
• R2 cannot decrease when predictors added to model
• With single predictor, R2 = r2 , R = |r|
Con’d
• We would like some measure of how well our regression model actually fits the
data.
• We have goodness of fit statistics to test this: i.e. how well the sample regression
function (srf) fits the data.
• The most common goodness of fit statistic is known as R2. One way to define R2 is
to say that it is the square of the correlation coefficient between y and .
• For another explanation, recall that what we are interested in doing is explaining
the variability of y about its mean value, , i.e. the total sum of squares, TSS:
TSS yt y
2
• We can split the TSS into two parts, the part which we have explained (known as
the explained sum of squares, ESS) and the part which we did not explain using
the model (the RSS).
Recall how to define R2
• That is, TSS = ESS + RSS
ty y 2
tˆ
y y 2
t
ˆ
u 2
t t t
• R2 must always lie between zero and one. To understand this, consider two extremes
RSS = TSS i.e. ESS = 0 so R2 = ESS/TSS = 0
ESS = TSS i.e. RSS = 0 so R2 = ESS/TSS = 1
Example: Multiple Coefficient of
Determination
Regression Statistics
SSR 29460.0
Multiple R 0.72213
r
2
.52148
R Square 0.52148 SST 56493.3
Adjusted R Square 0.44172
52.1% of the variation in pie sales
Standard Error 47.46341
is explained by the variation in
Observations 15
price and advertising
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
2. R2 never falls if more regressors are added. to the regression, e.g. consider:
Regression 1: yt = 1 + 2x2t + 3x3t + ut
Regression 2: y = 1 + 2x2t + 3x3t + 4x4t + ut
………R2 will always be at least as high for regression 2 relative to regression 1.
3. R2 quite often takes on values of 0.9 or higher for time series regressions.
Adjusted R2
• In order to get around these problems, a modification is often made which takes into account the
loss of degrees of freedom associated with adding extra variables. This is known as R 2 , or
adjusted R2:
T 1
R 2 1 (1 R 2 )
T k
• So if we add an extra regressor, k increases and unless R2 increases by a more than offsetting
amount, R 2 will actually fall.
Adjusted R2
(continued)
• Shows the proportion of variation in Y explained by all
X variables adjusted for the number of X variables used
2 n 1 SSR /(n k 1)
R2
1 (1 r ) 1
adj
n k 1 SST /(
(where n = sample size, k = number of independent variables)
n 1)
• Penalizes excessive use of unimportant independent
variables
• Smaller than R2
• Useful in comparing among models
Adjusted R2
.44172
Regression Statistics 2
Multiple R 0.72213 R adj
R Square 0.52148
Adjusted R Square 0.44172
44.2% of the variation in pie sales is
Standard Error 47.46341
explained by the variation in price and
Observations 15 advertising, taking into account the sample
size and number of independent variables
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
MSR SSR / k
FSTAT
MSE SSE /(n k 1)
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
Test Statistic:
bj 0
t STAT
Sb j (df = n – k – 1)
Regression Statistics
t Stat for Price is tSTAT = -2.306, with
Multiple R 0.72213
R Square 0.52148
p-value .0398
Adjusted R Square 0.44172
Standard Error 47.46341 t Stat for Advertising is tSTAT = 2.855,
Observations 15 with p-value .0145
ANOVA df SS MS F Significance F
Regression 2 29460.027 14730.013 6.53861 0.01201
Residual 12 27033.306 2252.776
Total 14 56493.333
b j tα / 2 Sb where t has
(n – k – 1) d.f.
j