linear regression analysis using ms excel tutorial for assignment 2 civ e 342

9
Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Upload: allison-baldwin

Post on 05-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Linear Regression AnalysisUsing MS Excel

Tutorial for Assignment 2

Civ E 342

Page 2: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

The Regression Analysis Procedure

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

Page 3: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 1: Import Data to Excel• Objective:

• Import original data to Excel. If it is a text file, open the file in Excel and follow the steps!

• Label each column - variable names

• Define (label) independent and dependent variables (x1,x2,...,y)

• Demo

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

Page 4: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 2: Correlation Analysis• Objectives:

– Important factors?

– Correlation between factors?

– Factors with non-linear effect - transform into linear if necessary

• Method 1: Correlation matrix– Excel - “Tools - Data Analysis… -

Correlation”

– Identify the factors that are correlated - high coefficient of correlation

• Method 2: Scatter diagram

• Demo

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

Page 5: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 3: Assume a Functional Form• Objective

– Identify factors and form of relationship

• Methods:– A trial-and-error process:

– Stepwise process (not covered in this tutorial)

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

y = 0 + 1 x1

y = 0 + 1 x1 + 2 x2

Page 6: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 4: Prepare Data Table

• Objective– For the assumed equation:

y = 0 + 1 x1 + 2 x2Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

X1 X2 y

12 65 8765

4 76 9543

32 3 1287

Demo

Page 7: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 5: Regress Using Excel

• Objective: determine the coefficients that make the equation best fit to the data

• Method:– Method of Least Squares

• Demo

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

Page 8: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 6: Assess the Adequacy of the Regression Model

• Objective:• Measures:

– Coefficient of Determination (R2)

– t-tests

ti>t, n-k-1, -level of significance

n-sample size

k-no of independent variables

– Residual plot

– Intuitive acceptability

• Demo

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

Page 9: Linear Regression Analysis Using MS Excel Tutorial for Assignment 2 Civ E 342

Step 7: Select the Best Regression Model

• Objective:

• Model Application– Models are valid only for the values of the variables within the range of the original data!

Assume Equation

Import Data to Excel

Correlation Analysis

Prepare Data Table

Regress Using Excel

Quality Analysis

No

YesTry More Equ.?

Select the Best Equ.

y = 0 + 1 x1 + 2 x2

t1 t2 R2