44
ADNAN MENDERES UNIVERSITY FACULTY OF ENGINEERING MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Embed Size (px)

Citation preview

Page 1: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

ADNAN MENDERES UNIVERSITYFACULTY OF ENGINEERING

MAT 254 – Probability and StatisticsSections 1,2 & 3

2015 - Spring

Page 2: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

2

1) Importance and basic concepts of Probability and Statistics. Introduction to Statistics and data analysis

2) Data collection and presentation3) Measures of central tendency; mean, median, mode4) Probability5) Conditional probability 6) Discrete probability distributions7) Continuous probability distributions

Midterm Exam (April 1, 17:30)8) Hypothesis testing (2 weeks)9) Student t-test (2 weeks)10) Chi-square

11)Correlation and regression analysis12) REVIEW

Final Exam (May 25- June 7)

web.adu.edu.tr/user/oboyaci

Outline

MAT254 - Probability & Statistics

Page 3: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

MAT254 - Probability & Statistics 3

Definition of Terms

CORRELATION The correlations term is used when: 1) Both variables are random variables, 2) The end goal is simply to find a number that expresses the

relation between the variables

REGRESSIONThe regression term is used when

1) One of the variables is a fixed variable, 2) The end goal is use the measure of relation to predict

values of the random variable based on values of the fixed variable

Page 4: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

11 - 4

Figure 11.3 Scatter diagram with regression lines

Page 5: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

11 - 5

Figure 11.1 A linear relationship; b0: intercept; b1: slope

Page 6: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

11 - 6

Figure 11.2 Hypothetical (x,y) data scattered around the true regression line for n = 5

Page 7: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

11 - 7

Table 11.1 Measures of Reduction in Solids and Oxygen Demand

Page 8: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-8

Scatter Plots and Correlation

A scatter plot (or scatter diagram) is used to show the relationship between two variables

Correlation analysis is used to measure strength of the association (linear relationship) between two variables

◦Only concerned with strength of the relationship

◦No causal effect is implied

Page 9: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-9

Scatter Plot Examples

y

x

y

x

y

y

x

x

Linear relationships Curvilinear relationships

Page 10: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-10

Scatter Plot Examples

y

x

y

x

y

y

x

x

Strong relationships Weak relationships

(continued)

Page 11: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-11

Scatter Plot Examples

y

x

y

x

No relationship

(continued)

Page 12: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-12

Correlation Coefficient

Correlation measures the strength of the linear association between two variables

The sample correlation coefficient r is a measure of the strength of the linear relationship between two variables, based on sample observations

(continued)

Page 13: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-13

Features of r

Unit free Range between -1 and 1 The closer to -1, the stronger the

negative linear relationship The closer to 1, the stronger the positive

linear relationship The closer to 0, the weaker the linear

relationship

Page 14: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-14r = +.3 r = +1

Examples of Approximate r Values

y

x

y

x

y

x

y

x

y

x

r = -1 r = -.6 r = 0

Page 15: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-15

Calculating the Correlation Coefficient

])yy(][)xx([

)yy)(xx(r

22

where:r = Sample correlation coefficientn = Sample sizex = Value of the independent variabley = Value of the dependent variable

])y()y(n][)x()x(n[

yxxynr

2222

Sample correlation coefficient:

or the algebraic equivalent:

Page 16: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-16

Calculation Example

Tree Height

Trunk Diameter

y x xy y2 x2

35 8 280 1225 64

49 9 441 2401 81

27 7 189 729 49

33 6 198 1089 36

60 13 780 3600 169

21 7 147 441 49

45 11 495 2025 121

51 12 612 2601 144

=321 =73 =3142 =14111 =713

Page 17: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-17

0

10

20

30

40

50

60

70

0 2 4 6 8 10 12 14

0.886

](321)][8(14111)(73)[8(713)

(73)(321)8(3142)

]y)()y][n(x)()x[n(

yxxynr

22

2222

Trunk Diameter, x

TreeHeight, y

Calculation Example(continued)

r = 0.886 → relatively strong positive linear association between x and y

Page 18: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-18

Introduction to Regression Analysis

Regression analysis is used to:◦ Predict the value of a dependent variable based

on the value of at least one independent variable

◦ Explain the impact of changes in an independent variable on the dependent variable

Dependent variable: the variable we wish to explain

Independent variable: the variable used to explain the dependent variable

Page 19: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-19

Simple Linear Regression Model

Only one independent variable, x Relationship between x and y is

described by a linear function Changes in y are assumed to be

caused by changes in x

Page 20: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-20

Linear Regression Assumptions

Error values (ε) are statistically independent

Error values are normally distributed for any given value of x

The probability distribution of the errors is normal

The distributions of possible ε values have equal variances for all values of x

The underlying relationship between the x variable and the y variable is linear

Page 21: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-21

Types of Regression Models

Positive Linear Relationship

Negative Linear Relationship

Relationship NOT Linear

No Relationship

Page 22: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-22

εxββy 10 Linear component

Population Linear Regression

The population regression model:

Population y intercept

Population SlopeCoefficient

Random Error term, or residualDependent

Variable

Independent Variable

Random Error component

Page 23: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-23

Population Linear Regression

(continued)

Random Error for this x value

y

x

Observed Value of y for xi

Predicted Value of y for xi

εxββy 10

xi

Slope = β1

Intercept = β0

εi

Page 24: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-24

xbby 10i

The sample regression line provides an estimate of the population regression line

Estimated Regression Model(Fitted Regression)

Estimate of the regression

intercept

Estimate of the regression slope

Estimated (or predicted) y value

Independent variable

The individual random error terms ei have a mean of zero

Page 25: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-25

Least Squares Criterion

b0 and b1 are obtained by finding the values of b0 and b1 that minimize the sum of the squared residuals

210

22

x))b(b(y

)y(ye

Page 26: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-26

The Least Squares Equation

The formulas for b1 and b0 are:

algebraic equivalent for b1:

n

)x(x

n

yxxy

b 22

1

21 )x(x

)y)(yx(xb

xbyb 10

and

Page 27: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-27

b0 is the estimated average value

of y when the value of x is zero

b1 is the estimated change in the

average value of y as a result of a one-unit change in x

Interpretation of the Slope and the Intercept

Page 28: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-28

Simple Linear Regression Example

A real estate agent wishes to examine the relationship between the selling price of a home and its size (measured in square feet)

A random sample of 10 houses is selected◦Dependent variable (y) = house price in

$1000s◦Independent variable (x) = square feet

Page 29: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-29

Sample Data forHouse Price Model

House Price in $1000s(y)

Square Feet (x)

245 1400

312 1600

279 1700

308 1875

199 1100

219 1550

405 2350

324 2450

319 1425

255 1700

Page 30: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-30

0

50

100

150

200

250

300

350

400

450

0 500 1000 1500 2000 2500 3000

Square Feet

Ho

use

Pri

ce (

$100

0s)

Graphical Presentation

House price model: scatter plot and regression line

feet) (square 0.10977 98.24833 price house

Slope = 0.10977

Intercept = 98.248

Page 31: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-31

Interpretation of the Intercept, b0

b0 is the estimated average value of Y

when the value of X is zero (if x = 0 is in the range of observed x values)

◦ Here, no houses had 0 square feet, so b0 =

98.24833 just indicates that, for houses within the range of sizes observed, $98,248.33 is the portion of the house price not explained by square feet

feet) (square 0.10977 98.24833 price house

Page 32: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-32

Interpretation of the Slope Coefficient, b1

b1 measures the estimated change

in the average value of Y as a result of a one-unit change in X◦ Here, b1 = .10977 tells us that the average value

of a house increases by .10977($1000) = $109.77, on average, for each additional one square foot of size

feet) (square 0.10977 98.24833 price house

Page 33: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-33

Least Squares Regression Properties

The sum of the residuals from the least squares regression line is 0 ( )

The sum of the squared residuals is a minimum (minimized )

The simple regression line always passes through the mean of the y variable and the mean of the x variable

The least squares coefficients are unbiased

estimates of β0 and β1

0)y(y ˆ

2)y(y ˆ

Page 34: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-34

Explained and Unexplained Variation

Total variation is made up of two parts:

SSR SSE SST Total sum of Squares

Sum of Squares Regression

Sum of Squares Error

2)yy(SST 2)yy(SSE 2)yy(SSR

where:

= Average value of the dependent variable

y = Observed values of the dependent variable

= Estimated value of y for the given x valuey

y

Page 35: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-35

SST = total sum of squares

◦ Measures the variation of the yi values around their mean y

SSE = error sum of squares

◦ Variation attributable to factors other than the relationship between x and y

SSR = regression sum of squares

◦ Explained variation attributable to the relationship between x and y

(continued)

Explained and Unexplained Variation

Page 36: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-36

(continued)

Xi

y

x

yi

SST = (yi - y)2

SSE = (yi - yi )2

SSR = (yi - y)2

_

_

_

y

y

y_y

Explained and Unexplained Variation

Page 37: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-37

The coefficient of determination is the portion of the total variation in the dependent variable that is explained by variation in the independent variable

The coefficient of determination is also called R-squared and is denoted as R2

Coefficient of Determination, R2

SST

SSRR 2 1R0 2 where

Page 38: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-38

R2 = +1

Examples of Approximate R2 Values

y

x

y

x

R2 = 1

R2 = 1

Perfect linear relationship between x and y:

100% of the variation in y is explained by variation in x

Page 39: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-39

Examples of Approximate R2 Values

y

x

y

x

0 < R2 < 1

Weaker linear relationship between x and y:

Some but not all of the variation in y is explained by variation in x

(continued)

Page 40: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-40

Examples of Approximate R2 Values

R2 = 0

No linear relationship between x and y:

The value of Y does not depend on x. (None of the variation in y is explained by variation in x)

y

xR2 = 0

(continued)

Page 41: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-41

Coefficient of determination

Coefficient of Determination, R2

squares of sum total

regressionby explained squares of sum

SST

SSRR 2

(continued)

Note: In the single independent variable case, the coefficient of determination is

where:R2 = Coefficient of determination

r = Simple correlation coefficient

22 rR

Page 42: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-42

House Price in $1000s

(y)

Square Feet (x)

245 1400

312 1600

279 1700

308 1875

199 1100

219 1550

405 2350

324 2450

319 1425

255 1700

(sq.ft.) 0.1098 98.25 price house

Estimated Regression Equation:

Example: House Prices

Predict the price for a house with 2000 square feet

Page 43: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc.

Chap

14-43

317.85

0)0.1098(200 98.25

(sq.ft.) 0.1098 98.25 price house

Example: House Prices

Predict the price for a house with 2000 square feet:

The predicted price for a house with 2000 square feet is 317.85($1,000s) = $317,850

(continued)

Page 44: MAT 254 – Probability and Statistics Sections 1,2 & 3 2015 - Spring

44

Probability & Statistics

MAT254 - Probability & Statistics

END OF THE LECTURE…