Docsity

Multiple Linear Regression with Two Variables | STAT 537, Exams of Statistics

Partial preview of the text

Download Multiple Linear Regression with Two Variables | STAT 537 and more Exams Statistics in PDF only on Docsity!

Multiple Regression

Multiple Linear Regression with

Two Variables

Consider the two-variable model

Y = β 0 + β 1 X 1 + β 2 X 2 + ε

where

Y is the dependent or response variable. X 1 and X 2 are the independent or predictor variables. ε is the error term. β 0 , β 1 , and β 2 are unknown parameters.

Picturing the Model: No

Relationship



  • (^) β *

X 1

Y

X 2

0

Picturing the Model: A

Relationship

X

X











Y




2

1

Multiple Regression

  • When there was only a single predictor x, a 2-dimensional scatter plot would provide a visual representation of the data.
  • With k predictors, and a response variable y, it would take a (k+1)-dimensional plot to provide a similar representation.
  • Each variable represents another dimension.

Multiple Regression

  • As with Simple Linear Regression, we typically do not have access to the entire population.
  • Instead, we have a set of n observations, with each observation measured on all k predictor variables and on the response variable.

HATCO Data Obs ID X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X 12 12 4.11.8 0.63.0 6.96.3 4.76.6 2.42.5 2.34.0 5.28.4 01 3243 4.24.3 (^10 01 10 ) 34 34 3.42.7 5.21.0 5.77.1 6.05.9 4.31.8 2.72.3 8.27.8 11 4832 5.23.9 (^00 11 11 ) 56 56 6.01.9 0.93.3 9.67.9 7.84.8 3.42.6 4.61.9 4.59.7 01 5845 6.84.4 (^10 01 11 ) 78 78 4.61.3 2.44.2 9.56.2 6.65.1 3.52.8 4.52.2 7.66.9 01 4644 5.84.3 (^10 01 10 ) 109 109 5.54.0^ 1.63.5^ 9.46.5^ 4.76.0^ 3.53.7^ 3.03.2^ 7.68.7^01 6354 5.45.4^10 01 10

Estimation of Parameters

  • The parameters β 0 , β 1 , β 2 , • • • , βk can also be estimated by the Method of Least Squares.
  • These estimates are denoted b 0 , b 1 , b 2 , • • • , bk

ANOVA Table

  • The F-statistic is the test statistic for testing the hypothesis H 0 : β 1 = β 2 = • • • = βk = 0 H 1 : ∼ H (^0)

The test statistic F has an F distribution with k and n-1 degrees of freedom F ∼ Fk,n-k-

ANOVA Table

  • Large values of F provide evidence that the null hypothesis is false.
  • The typical yardstick that is used here is the p-value. If p < α , then H 0 is rejected, where α is chosen as some small value, typically 0.05 or 0.01.

Statistical Inference

  • In Multiple Regression, we can also test an hypothesis about each individual parameter βi : H 0 : βi = 0 H 1 : βi ≠ 0 in order to determine whether the particular predictor variable x (^) i has any significant relationship to the response variable y, holding all other predictors constant.

Statistical Inference

  • The test statistic for testing the hypothesis

H 0 : βi = 0 H 1 : βi ≠ 0 is a t statistic, with n-k-1 degrees of freedom

Common Problems

Four common problems with regression are

  • nonconstant variance
  • correlated errors
  • influential observations
  • collinearity.

Variable Selection

  • For a given response variable y, let {x 1 , x 2 , • • • ,x (^) k } be the potential set of predictor variables.
  • To make the equation useful for predictive purposes, we want to include as many of the x (^) i’s as possible.
  • For parsimony and for controlling costs, we want to include as few of the x (^) i’s as possible

Stepwise Selection Methods

Forward Selection

Backward Elimination

Stepwise Selection

Backward Elimination

  1. Fit the model containing all (remaining) predictors.
  2. Test each predictor variable, one at a time, for a significant relationship with y.
  3. Identify the variable with the largest p- value. If p > α, remove this variable from the model, and return to (1.).
  4. Otherwise, stop and use the existing model.

Stepwise Selection

  1. Fit all models with one (more) predictor.
  2. Test each of these predictor variables, for a significant relationship with y.
  3. Identify the variable with the smallest p-value. If p < α, add this variable to the model, and return to (1.).
  4. Now, for the model being considered, test each predictor variable, one at a time, for a significant relationship with y.
  5. Identify the variable with the largest p-value. If p > α, remove this variable from the model, and return to (1.).
  6. Otherwise, stop and use the existing model.

Variable Transformations

  • The response variable y, and/or the explanatory variables x 1 , x 2 , • • • ,x (^) k, can be transformed, - in order to provide a better fitting model, - or because of theoretical considerations.

Variable Transformations

  • Consider the model with a single predictor: y = β 0 + β 1 x + ε
  • Addition of a quadratic term to the model: y = β 0 + β 1 x + β 2 x 2 + ε
  • More general polynomial regression models: y = β 0 + β 1 x + β 2 x 2 + β 3 x 3 + ε

Variable Transformations

  • Inverse transformations:

0 1 y = + 1 + x

β β ⎛⎜^ ⎞⎟ ε ⎝ ⎠ or

0 1

(^1) = + x+ y

β β ε

Analysis of Residuals

  • If model is correct, then the residuals ei should exhibit tendencies confirming our assumptions.
  • Otherwise, the residuals may reveal a violation of one or more of the assumptions.

Analysis of Residuals

  • We typically plot ei vs. each predictor variable: ei vs. x (^) i ei vs. x (^) i - - - ei vs. x (^) ik
  • We also plot ei vs. y$

Unsatisfactory Residual Patterns

Variance of residuals increases with the variable plotted on the horizontal axis.

Unsatisfactory Residual Patterns

An important variable is missing from model.

Additional things that must be

considered in Multiple Regression

  • Influential observations & outliers
  • Multicollinearity
  • Missing Data

Influential Observations

y

x

y = b^ ˆ^0 +b x 1

Influential observation

Multicollinearity

  • Exact collinearity between two variables exists when the values of the one variable are a multiple of the values of the other variable.
  • Similarly, exact collinearity among more than two variables exists when one variable can be formed as a linear combination of the other variables.
  • Collinearity among more than two variables exists if there is a high multiple correlation when one of the variables is regressed on the others.

Multicollinearity

  • The effect of multicollinearity is to inflate the variance of the parameter estimates b 0 , b 1 , b 2 , • • • , bk
  • This is not desirable, since it would cause the confidence interval to be so large as to be uninterpretable, and it would cause the test statistic to be so small that it would be difficult to correctly recognize the importance of that variable.