ADNAN MENDERES UNIVERSITY FACULTY OF ENGINEERING MAT 254

  • Slides: 44
Download presentation
ADNAN MENDERES UNIVERSITY FACULTY OF ENGINEERING MAT 254 – Probability and Statistics Sections 1,

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

Outline 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) Importance and basic

Outline 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) Importance and basic concepts of Probability and Statistics. Introduction to Statistics and data analysis Data collection and presentation Measures of central tendency; mean, median, mode Probability Conditional probability Discrete probability distributions Continuous probability distributions Midterm Exam (April 1, 17: 30) Hypothesis testing (2 weeks) Student t-test (2 weeks) Chi-square 11)Correlation 12) and regression analysis REVIEW Final Exam (May 25 - June 7) web. adu. edu. tr/user/oboyaci MAT 254 - Probability & Statistics 2

Definition of Terms CORRELATION The correlations term is used when: 1) Both variables are

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 REGRESSION The 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 MAT 254 - Probability & Statistics 3

Figure 11. 3 Scatter diagram with regression lines 11 - 4 Copyright © 2010

Figure 11. 3 Scatter diagram with regression lines 11 - 4 Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

Figure 11. 1 A linear relationship; b 0: intercept; b 1: slope 11 -

Figure 11. 1 A linear relationship; b 0: intercept; b 1: slope 11 - 5 Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

Figure 11. 2 Hypothetical (x, y) data scattered around the true regression line for

Figure 11. 2 Hypothetical (x, y) data scattered around the true regression line for n = 5 11 - 6 Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

Table 11. 1 Measures of Reduction in Solids and Oxygen Demand 11 - 7

Table 11. 1 Measures of Reduction in Solids and Oxygen Demand 11 - 7 Copyright © 2010 Pearson Addison-Wesley. All rights reserved.

Scatter Plots and Correlation �A scatter plot (or scatter diagram) is used to show

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 Chap 14 -8 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Scatter Plot Examples Linear relationships y Curvilinear relationships y x y x x Chap

Scatter Plot Examples Linear relationships y Curvilinear relationships y x y x x Chap 14 -9 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Scatter Plot Examples (continued) Strong relationships y Weak relationships y x y x x

Scatter Plot Examples (continued) Strong relationships y Weak relationships y x y x x Chap 14 -10 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Scatter Plot Examples (continued) No relationship y x Chap 14 -11 Business Statistics: A

Scatter Plot Examples (continued) No relationship y x Chap 14 -11 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Correlation Coefficient (continued) � Correlation measures the strength of the linear association between two

Correlation Coefficient (continued) � 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 Chap 14 -12 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Features of r � Unit free � Range between -1 and 1 � The

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 Chap 14 -13 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Examples of Approximate r Values y y y r = -1 x r =

Examples of Approximate r Values y y y r = -1 x r = -. 6 y x r=0 y r = +. 3 x r = +1 Chap 14 -14 x Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc. x

Calculating the Correlation Coefficient Sample correlation coefficient: or the algebraic equivalent: where: r =

Calculating the Correlation Coefficient Sample correlation coefficient: or the algebraic equivalent: where: r = Sample correlation coefficient n = Sample size x = Value of the independent variable y = Value of the dependent variable Chap 14 -15 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Calculation Example Tree Height Trunk Diameter y x xy y 2 x 2 35

Calculation Example Tree Height Trunk Diameter y x xy y 2 x 2 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 Chap 14 -16 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Calculation Example (continued) Tree Height, y Trunk Diameter, x r = 0. 886 →

Calculation Example (continued) Tree Height, y Trunk Diameter, x r = 0. 886 → relatively strong positive linear association between x and y Chap 14 -17 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Introduction to Regression Analysis � Regression analysis is used to: ◦ Predict the value

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 Chap 14 -18 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Simple Linear Regression Model � Only one independent variable, x � Relationship between x

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 Chap 14 -19 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Linear Regression Assumptions � Error values (ε) are statistically independent � Error values are

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 Chap 14 -20 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Types of Regression Models Positive Linear Relationship Negative Linear Relationship NOT Linear No Relationship

Types of Regression Models Positive Linear Relationship Negative Linear Relationship NOT Linear No Relationship Chap 14 -21 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Population Linear Regression The population regression model: Population y intercept Dependent Variable Population Slope

Population Linear Regression The population regression model: Population y intercept Dependent Variable Population Slope Coefficient Linear component Independent Variable Random Error term, or residual Random Error component Chap 14 -22 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Population Linear Regression (continued) y Observed Value of y for xi εi Predicted Value

Population Linear Regression (continued) y Observed Value of y for xi εi Predicted Value of y for xi Slope = β 1 Random Error for this x value Intercept = β 0 x xi Chap 14 -23 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Estimated Regression Model (Fitted Regression) The sample regression line provides an estimate of the

Estimated Regression Model (Fitted Regression) The sample regression line provides an estimate of the population regression line Estimated (or predicted) y value Estimate of the regression intercept Estimate of the regression slope Independent variable The individual random error terms ei have a mean of zero Chap 14 -24 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Least Squares Criterion � b 0 and b 1 are obtained by finding the

Least Squares Criterion � b 0 and b 1 are obtained by finding the values of b 0 and b 1 that minimize the sum of the squared residuals Chap 14 -25 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

The Least Squares Equation � The formulas for b 1 and b 0 are:

The Least Squares Equation � The formulas for b 1 and b 0 are: algebraic equivalent for b 1: and Chap 14 -26 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Interpretation of the Slope and the Intercept �b 0 is the estimated average value

Interpretation of the Slope and the Intercept �b 0 is the estimated average value of y when the value of x is zero �b 1 is the estimated change in the average value of y as a result of a one-unit change in x Chap 14 -27 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Simple Linear Regression Example �A real estate agent wishes to examine the relationship between

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 $1000 s ◦ Independent variable (x) = square feet Chap 14 -28 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Sample Data for House Price Model House Price in $1000 s (y) Square Feet

Sample Data for House Price Model House Price in $1000 s (y) Square Feet (x) 245 1400 312 1600 279 1700 308 1875 199 1100 219 1550 405 2350 324 2450 319 1425 255 1700 Chap 14 -29 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Graphical Presentation � House price model: scatter plot and regression line Slope = 0.

Graphical Presentation � House price model: scatter plot and regression line Slope = 0. 10977 Intercept = 98. 248 Chap 14 -30 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Interpretation of the Intercept, b 0 � b 0 is the estimated average value

Interpretation of the Intercept, b 0 � b 0 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 b 0 = 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 Chap 14 -31 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Interpretation of the Slope Coefficient, b 1 �b 1 measures the estimated change in

Interpretation of the Slope Coefficient, b 1 �b 1 measures the estimated change in the average value of Y as a result of a one-unit change in X ◦ Here, b 1 =. 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 Chap 14 -32 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Least Squares Regression Properties � � The sum of the residuals from the least

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 Chap 14 -33 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Explained and Unexplained Variation � Total variation is made up of two parts: Total

Explained and Unexplained Variation � Total variation is made up of two parts: Total sum of Squares Sum of Squares Error Sum of Squares Regression where: = Average value of the dependent variable y = Observed values of the dependent variable = Estimated value of y for the given x. Business value. Statistics: A Decision Chap 14 -34 -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Explained and Unexplained Variation (continued) � SST = total sum of squares ◦ Measures

Explained and Unexplained Variation (continued) � 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 Chap 14 -35 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Explained and Unexplained Variation (continued) y yi 2 SSE = (yi - yi )

Explained and Unexplained Variation (continued) y yi 2 SSE = (yi - yi ) _ y y SST = (yi - y)2 _2 SSR = (yi - y) _ y x Xi Chap 14 -36 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Coefficient of Determination, R 2 � The coefficient of determination is the portion of

Coefficient of Determination, R 2 � 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 R 2 where Chap 14 -37 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Examples of Approximate R 2 Values y R 2 = 1 x 100% of

Examples of Approximate R 2 Values y R 2 = 1 x 100% of the variation in y is explained by variation in x y R 2 = +1 Perfect linear relationship between x and y: x Chap 14 -38 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Examples of Approximate R 2 Values (continued) y 0 < R 2 < 1

Examples of Approximate R 2 Values (continued) y 0 < R 2 < 1 x Weaker linear relationship between x and y: Some but not all of the variation in y is explained by variation in x y x Chap 14 -39 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Examples of Approximate R 2 Values (continued) R 2 = 0 y No linear

Examples of Approximate R 2 Values (continued) R 2 = 0 y No linear relationship between x and y: R 2 = 0 x The value of Y does not depend on x. (None of the variation in y is explained by variation in x) Chap 14 -40 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Coefficient of Determination, R 2 (continued) Coefficient of determination Note: In the single independent

Coefficient of Determination, R 2 (continued) Coefficient of determination Note: In the single independent variable case, the coefficient of determination is where: R 2 = Coefficient of determination r = Simple correlation coefficient Chap 14 -41 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Example: House Prices House Price in $1000 s (y) Square Feet (x) 245 1400

Example: House Prices House Price in $1000 s (y) Square Feet (x) 245 1400 312 1600 279 1700 308 1875 199 1100 219 1550 405 2350 324 2450 319 1425 255 1700 Estimated Regression Equation: Predict the price for a house with 2000 square feet Chap 14 -42 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Example: House Prices (continued) Predict the price for a house with 2000 square feet:

Example: House Prices (continued) Predict the price for a house with 2000 square feet: The predicted price for a house with 2000 square feet is 317. 85($1, 000 s) = $317, 850 Chap 14 -43 Business Statistics: A Decision -Making Approach, 7 e © 2008 Prentice-Hall, Inc.

Probability & Statistics END OF THE LECTURE… MAT 254 - Probability & Statistics 44

Probability & Statistics END OF THE LECTURE… MAT 254 - Probability & Statistics 44