Docsity

Lecture Notes: Multiple Regression - An Introduction - Prof. James W. Dobbin, Study notes of Data Analysis & Statistical Methods

Toggle sidebar
bg1
Lecture Notes For Chapter 11, Multiple Regression
Multiple Regression
In multiple linear regression more than one explanatory variable is used to explain
or predict a single response variable. Many of the ideas of linear regression (one
explanatory variable, one response variable) carry over to multiple linear
regression.
Multiple Linear Regression Model
The statistical model for multiple linear regression is
0 1 1 2 2
.....
p p
y
x x x
p is the number of explanatory variables in the model.
The deviations/error,
, are independent and normally distributed with mean 0
and standard deviation σ.
The parameters of the model are
0
,
1
,
2
,…..,
p
, and σ.
So what do we do when we have more than one “X” variable?
1. Look at the variables individually. Graph (stem plot, histogram) each
variable, determine means, standard deviations, minimums, and maximums. Are
there any outliers?
2. Look at the relationships between the variables using the correlation and
scatter plots. Do a scatterplot, determine a correlation between each pair of data.
To determine a correlation between each pair, enter all the variables (the y and all
the x’s) into SPSS, the select Analyze>>Correlate>>Bivariate. The higher the
correlation between 2 variables, the lower the Sig.(2-tailed), the better. This will
help you determine which are the stronger relationships between the y and an x.
Lecture 13, Sections 11.1 & 11.2
Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Lecture Notes: Multiple Regression - An Introduction - Prof. James W. Dobbin and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

Lecture Notes For Chapter 11, Multiple Regression

Multiple Regression

In multiple linear regression more than one explanatory variable is used to explain

or predict a single response variable. Many of the ideas of linear regression (one

explanatory variable, one response variable) carry over to multiple linear

regression.

Multiple Linear Regression Model

The statistical model for multiple linear regression is

p p

y     x   x    x 

p is the number of explanatory variables in the model.

The deviations/error,^ ^ , are independent and normally distributed with mean 0

and standard deviation σ.

The parameters of the model are  0 ,  1 ,  2 ,….., ^ p , and σ.

So what do we do when we have more than one “X” variable?

1. Look at the variables individually. Graph (stem plot, histogram) each

variable, determine means, standard deviations, minimums, and maximums. Are

there any outliers?

2. Look at the relationships between the variables using the correlation and

scatter plots. Do a scatterplot, determine a correlation between each pair of data.

To determine a correlation between each pair, enter all the variables (the y and all

the x’s) into SPSS, the select Analyze>>Correlate>>Bivariate. The higher the

correlation between 2 variables, the lower the Sig.(2-tailed), the better. This will

help you determine which are the stronger relationships between the y and an x.

Lecture 13, Sections 11.1 & 11.

3. Do a regression to define the relationship of the variables. I start with all

potential explanatory variables and the response variable, the regression results

will indicate/confirm which relationships are strong.

For multiple linear regression a least squares procedure is used to estimate the

parameters  0 ,  1 ,  2 ,….., ^ p , and σ. The sample has n observations. Perform

the multiple regression procedure on the data from the n observations.

, , ,......,

p

b b b b (^) denote the estimators of the population parameters

 (^) ,

 (^) ,

 (^) ,…..,

p

 Another notation is^ b^ j , the j th estimator of ^ j , the j th population parameter,

where j = 0, 1, 2, …., p, and p is the number of explanatory variables in the

model.

For the ith observation, the predicted response is:

i ....

i i p ip

ybb xb x   b x

The ith residual, the difference between the observed and predicted response is:

i

e (^) = observed response – predicted response = ^

i i

yy

The method of least squares minimizes:

2 1

n i i

e

  , or

( (^) i )

i

^ y^  y  The parameter (^)  2 measures the variability of the response about the regression

equation. It is estimated by:

1

i

s

e n p

   The quantity n - p -1 is the degree of freedom associated with (^) s^2.

Lecture 13, Sections 11.1 & 11.

ANOVA table for multiple regression:

Source Degrees of

Freedom

Sum of

squares

Mean

square

F

Model

Error

p

n-p -

( ^ )^2

 y^ i  y

( ^ )^2

 yi^  yi

SSM/DFM

SSE/DFE

MSM/MSE

Total n -1 ( ) 2

 yi^  y

SST/DFT

Analysis of Variance F Test

In the multiple regression model, the hypothesis

p

H     

is tested by the analysis of variance F statistic

F= MSM/MSE

The P- value is the probability that a random variable having the F ( p,n-p -1)

distribution is greater than or equal to the calculated value of the F statistic.

The Squared Multiple Correlation

The statistic

i

i

R

y y

SSM

SST

y y

^ 

^ 

is the proportion of variation of the response variable y that is explained by the

explanatory variables^ x 1^ ,^ x 2^ ,^ x 3^ ,…..,^ x^ p.

Even if the p-value is small, you need to look at the R^2. If the R^2 is small, it

means the model you are using does not do a good job of explaining the variation

in “y”.

Lecture 13, Sections 11.1 & 11.

4. Interpret the results. Check the regression model assumptions.

Assumptions:

 Linearity. The regression equation must be of the right form to describe the

true underlying relationship among the variables. (To check for linearity,

look at those scatterplots of y against each x.)

 Constant variance. The variability of the residuals must be the same for all

values of the x variables. (To check for constant variance make a scatterplot

of residuals against predicted values.)

 Independence. Each explanatory variable should be independent of all the

other explanatory variables. (To check this, plot residuals vs. each of the

explanatory variables.) What out for collinearity, when any of the

explanatory variables has a strong linear relationship with another

explanatory variable. (Check those scatterplots of each x vs x, the

correlations, and the (^) R^2 ).

 Normality. The distribution of the residuals must be Normal for the t-tests

on the coefficients to follow the t-distribution exactly. (To check the

normality assumption, make a normal probability plot of residuals.)

5. Refine the model, if necessary. You are only interested in keeping the

variables which have strong relationships. So, try deleting deleting the variable

with the largest p-value, the weakest relationship, and re-run the regression. You

may have to do this again and again, each time deleting a variable with a weak

relationship.

To determine which is the best model, look at:

 the (^) R^2 ( it should not drop too much from the full model),

 p-values (should be lowest),

Any x variables left in the equations should have a significant p-value

from their t-test of their coefficient confidence intervals should not

contain 0.

 s, the standard deviation (should be as small as possible),

 the F-test statistic from ANOVA (should be the largest),

 and p-value from the ANOVA F-test (should be the smallest).

Lecture 13, Sections 11.1 & 11.

a) Look at each variable individually using graphs and descriptive

statistics. Any outliers?

Enter data in SPSS, then select> Analyze>Descriptive

Statistics>Explore. Select Plots options, Statistics options.

Lecture 13, Sections 11.1 & 11.

b) Look at a scatterplot and a residual plot of taste versus acetic, taste

versus H2S and taste versus lactic. Do you see any problems?

Lecture 13, Sections 11.1 & 11.

c) Which explanatory variables (x’s, Acetic, H2S, Lactic) are most

strongly correlated to the response variable (y, taste)?

Select Analyze>>Correlate>>Bivariate.

Correlations taste Acetic H2S Lactic taste Pearson Correlation

Sig. (2-tailed) (^). .002 .000. N (^30 30 30 ) Acetic Pearson Correlation

Sig. (2-tailed) (^) .002. .000. N (^30 30 30 ) H2S Pearson Correlation

Sig. (2-tailed) (^) .000 .000.. N (^30 30 30 ) Lactic Pearson Correlation

Sig. (2-tailed) (^) .000 .000.. N (^30 30 30 ) ** Correlation is significant at the 0.01 level (2-tailed).

d) Find the LSR line for predicting taste using the three variables Acetic,

H2S, and Lactic.

Coefficients(a) Model Unstandardized Coefficients Standardized Coefficients B Std. Error Beta t Sig. 1 (Constant ) -28.877^ 19.735^ -1.463^. Acetic (^) .328 4.460 .012 .073. H2S (^) 3.912 1.248 .512 3.133. Lactic (^) 19.671 8.629 .367 2.280. a Dependent Variable: Taste Taste = -28.877 + .328 (Acetic) + 3.912 (H2S) + 19.671 (Lactic)

e) Give the 95% confidence intervals for the regression coefficients of

your explanatory variables. Do any of the intervals contain the point 0?

Lecture 13, Sections 11.1 & 11.

Coefficients(a) Model Unstandardized Coefficients Standardized Coefficients B Std. Error Beta t Sig. 1 (Constant ) -27.592^ 8.982^ -3.072^. H2S (^) 3.946 1.136 .516 3.475. Lactic (^) 19.887 7.959 .371 2.499. a Dependent Variable: Taste

Taste = -27.592 + 3.946 (H2S) + 19.887 (Lactic)

j) What is the percent of the variation in taste explained by this LSR line?

Model Summary(b) Model R R Square Adjusted R Square Std. Error of the Estimate (^1) .807(a) .652 .626 9. a Predictors: (Constant), , b Dependent Variable: ANOVA(b) Model Sum of Squares df Mean Square F Sig. 1 Regressio n 4993.921^2 2496.961^ 25.260^ .000(a) Residual (^) 2668.965 27 98. Total 7662.887 29 a Predictors: (Constant), , b Dependent Variable:

65.2% of the variation in taste is explained by this LSR line.

k) Did removing the explanatory variable acetic improve the overall

model?

l) Is the assumption of model normality meet?

Lecture 13, Sections 11.1 & 11.

m) The F statistic reported for the second model is F = 25.2600. State the

null and alternative hypotheses for this statistic. Give the degrees of

freedom and the P -value for this test. What do you conclude?

Lecture 13, Sections 11.1 & 11.