REGRESSION MODEL WITH TWO EXPLANATORY VARIABLES

Содержание

Слайд 2

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

Y

X2

X1

β0

1

This sequence provides a geometrical interpretation of

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES Y X2 X1 β0 1 This
a multiple regression model with two explanatory variables.

Y – weekly salary ($)
X1 – length of employment (in months)
X2 – age (in years)

Specifically, we will look at weekly salary function model where weekly salary, Y, depend on length of employment X1, and age, X2.

Слайд 3

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

Y

X2

X1

β0

3

The model has three dimensions, one each

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES Y X2 X1 β0 3 The
for Y, X1, and X2. The starting point for investigating the determination of Y is the intercept, β0.

Y – weekly salary ($)
X1 – length of employment (in months)
X2 – age (in years)

Слайд 4

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

Y

X2

X1

β0

4

Literally the intercept gives weekly salary for

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES Y X2 X1 β0 4 Literally
those respondents who have no age (??) and no length of employment (??). Hence a literal interpretation of β0 would be unwise.

Y – weekly salary ($)
X1 – length of employment (in months)
X2 – age (in years)

Слайд 5

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

5

Y

X2

The next term on the right side

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES 5 Y X2 The next term
of the equation gives the effect of X1. A one month of employment increase in X1 causes weekly salary to increase by β1dollars, holding X2 constant.

X1

β0

pure X1 effect

β0 + β1X1

Y – weekly salary ($)
X1 – length of employment (in months)
X2 – age (in years)

Слайд 6

pure X2 effect

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

X1

β0

β0 + β2X2

Y

X2

6

Similarly, the third

pure X2 effect MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES X1 β0 β0
term gives the effect of variations in X2. A one year of age increase in X2 causes weekly salary to increase by β2 dollars, holding X1 constant.

Слайд 7

pure X2 effect

pure X1 effect

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

X1

β0

β0 + β2X2

β0

pure X2 effect pure X1 effect MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES
+ β1X1 + β2X2

Y

X2

β0 + β1X1

combined effect of X1 and X2

7

Different combinations of X1 and X2 give rise to values of weekly salary which lie on the plane shown in the diagram, defined by the equation Y = β0 + β1X1 + β2X2. This is the nonrandom component of the model.

Слайд 8

pure X2 effect

pure X1 effect

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

X1

β0

β0 + β2X2

β0

pure X2 effect pure X1 effect MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES
+ β1X1 + β2X2

β0 + β1X1 + β2X2+ ei

Y

X2

combined effect of X1 and X2

e

8

The final element of the model is the error term, e. This causes the actual values of Y to deviate from the plane. In this observation, e happens to have a positive value.

β0 + β1X1

Слайд 9

pure X2 effect

pure X1 effect

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

X1

β0

β0+ β1X1+ β2X2

β0

pure X2 effect pure X1 effect MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES
+ β1X1 + β2X2 + e

Y

X2

combined effect of X1 and X2

e

9

A sample consists of a number of observations generated in this way. Note that the interpretation of the model does not depend on whether X1 and X2 are correlated or not.

β0 + β1X1

β0 + β2X2

Слайд 10

pure X2 effect

pure X1 effect

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

10

X1

β0

β0 + β1X1+

pure X2 effect pure X1 effect MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES
β2X2

β0 + β1X1 + β2X2+ e

Y

X2

combined effect of X1 and X2

e

However we do assume that the effects of X1 and X2 on salary are additive. The impact of a difference in X1 on salary is not affected by the value of X2, or vice versa.

β0 + β1X1

β0 + β2X2

Слайд 11

Slope coefficients are interpreted as partial slope/partial regression coefficients:
? b1 =

Slope coefficients are interpreted as partial slope/partial regression coefficients: ? b1 =
average change in Y associated with a unit change in X1, with the other independent variables held constant (all else equal);
? b2 = average change in Y associated with a unit change in X2, with the other independent variables held constant (all else equal).

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

Слайд 12

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

The regression coefficients are derived using the

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES The regression coefficients are derived using
same least squares principle used in simple regression analysis. The fitted value of Y in observation i depends on our choice of b0, b1, and b2.

11

Слайд 13

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

The residual ei in observation i is

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES The residual ei in observation i
the difference between the actual and fitted values of Y.

12

Слайд 14

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

We define SSE, the sum of the

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES We define SSE, the sum of
squares of the residuals, and choose b0, b1, and b2 so as to minimize it.

13

Слайд 15

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

First we expand SSE as shown, and

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES First we expand SSE as shown,
then we use the first order conditions for minimizing it.

14

Слайд 16

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

We thus obtain three equations in three

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES We thus obtain three equations in
unknowns. Solving for b0, b1, and b2, we obtain the expressions shown above.

15

Слайд 17

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

The expression for b0 is a straightforward

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES The expression for b0 is a
extension of the expression for it in simple regression analysis.

16

Слайд 18

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

However, the expressions for the slope coefficients

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES However, the expressions for the slope
are considerably more complex than that for the slope coefficient in simple regression analysis.

17

Слайд 19

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

For the general case when there are

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES For the general case when there
many explanatory variables, ordinary algebra is inadequate. It is necessary to switch to matrix algebra.

18

Слайд 20

In matrix notation OLS may be written as:
Y = Xb + e
The

In matrix notation OLS may be written as: Y = Xb +
normal equations in matrix form are now
  XT Y = XTXb
And when we solve it for b we get:
b = (XTX)-1XTY
 where Y is a column vector of the Y values and X is a matrix containing a column of ones (to pick up the intercept) followed by a column of the X variables containing the observations on them and b is a vector containing the estimators of regression parameters.

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES

Слайд 21

MATRIX ALGEBRA: SUMMARY

A vector is a collection of n numbers or elements,

MATRIX ALGEBRA: SUMMARY A vector is a collection of n numbers or
collected either in a column (a column vector) or in a row (a row vector).
A matrix is a collection, or array, of numbers of elements in which the elements are laid out in columns and rows. The dimension of matrix is n x m where n is the number of rows and m is the number of columns.
Types of matrices
A matrix is said to be square if the number of rows equals the number of columns. A square matrix is said to be symmetric if its (i, j) element equals its (j, i) element. A diagonal matrix is a square matrix in which all the off-diagonal elements equal zero, that is, if the square matrix A is diagonal, then aij =0 for i≠j.
The transpose of a matrix switches the rows and the columns. That is, the transpose of a matrix turns the n x m matrix A into the m x n matrix denoted by AT, where the (i, j) element of A becomes the (j, i) element of AT; said differently, the transpose of a matrix A turns the rows of A into the columns of AT. The inverse of the matrix A is defined as the matrix for which A-1A=1. If in fact the inverse matrix A-1 exists, then A is said to be invertible or nonsingular.
Vector and matrix multiplication
The matrices A and B can be multiplied together if they are conformable, that is, if the number of columns of A equals the number of rows of B. In general, matrix multiplication does not commute, that is, in general AB≠ BA.

Слайд 22

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

Data for weekly salary based upon

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE Data for weekly salary based
the length of employment and
age of employees of a large industrial corporation are shown in the table.

Calculate the OLS estimates for regression coefficients for the available sample. Comment on your results.

Слайд 23

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

Y-weekly salary ($) X1 –length of employment

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE Y-weekly salary ($) X1 –length
(months) X2-age (years)

Слайд 24

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

Слайд 25

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

Y-weekly salary ($) X1 –length of employment

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE Y-weekly salary ($) X1 –length
(months) X2-age (years)

Our regression equation with two predictors (X1, X2):

Слайд 26

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

These are our data points in

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE These are our data points
3dimensional space (graph drawn using Statistica 6.0)

X1

X1

Y

X2

Слайд 27

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE

Data points with the regression surface

MULTIPLE REGRESSION WITH TWO EXPLANATORY VARIABLES: EXAMPLE Data points with the regression
(Statistica 6.0)

X1

X2

Y

b0

Имя файла: REGRESSION-MODEL-WITH-TWO-EXPLANATORY-VARIABLES-.pptx
Количество просмотров: 119
Количество скачиваний: 0