The Coefficient of Determination

Similar documents
Minimal Spanning Trees

The Critical-Path Algorithm

The Decreasing-Time Algorithm

The Normal Distribution

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013

Sampling Distribution Examples Sections 15.4, 15.5

Solving Recursive Sequences by Iteration

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Density Curves Sections

Rotations and Translations

XPath Lecture 34. Robb T. Koether. Hampden-Sydney College. Wed, Apr 11, 2012

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College

The Traveling Salesman Problem Nearest-Neighbor Algorithm

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

Scheduling and Digraphs

The Pairwise-Comparison Method

Displaying Distributions - Quantitative Variables

The Plurality-with-Elimination Method

The Traveling Salesman Problem Brute Force Method

Street-Routing Problems

Recursive Descent Parsers

Scope and Parameter Passing

Magnification and Minification

Recursion. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 17, 2018

XML Attributes. Lecture 33. Robb T. Koether. Hampden-Sydney College. Wed, Apr 25, 2018

Scope and Parameter Passing

List Iterators. Lecture 27 Section Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013

LR Parsing - Conflicts

List Iterators. Lecture 34 Section Robb T. Koether. Hampden-Sydney College. Wed, Apr 24, 2013

Function Definition Syntax Tree

XQuery FLOWR Expressions Lecture 35

The Graphics Pipeline

Binary Tree Applications

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

Recursive Linked Lists

The Class Construct Part 1

Recursion. Lecture 26 Sections , Robb T. Koether. Hampden-Sydney College. Mon, Apr 6, 2015

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014

Nondeterministic Programming in C++

Webpage Navigation. Lecture 27. Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2018

Linked Lists. Lecture 16 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 22, 2017

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018

LR Parsing - The Items

Implementing Linked Lists

Introduction to Databases

PHP Queries and HTML Forms Lecture 23

Building the Abstract Syntax Trees

The CYK Parsing Algorithm

Regular Expressions. Lecture 10 Sections Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2016

Friends and Unary Operators

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017

DTDs and XML Attributes

Programming Languages

Programming Languages

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013

List Iterator Implementation

Specular Reflection. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 4, 2017

Inheritance: The Fundamental Functions

The Projection Matrix

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014

The Graphics Pipeline

Recognition of Tokens

Integer Overflow. Lecture 8 Section 2.5. Robb T. Koether. Hampden-Sydney College. Mon, Jan 27, 2014

Ambient and Diffuse Light

The Mesh Class. Lecture 26. Robb T. Koether. Wed, Oct 28, Hampden-Sydney College

Introduction to Compiler Design

The Traveling Salesman Problem Cheapest-Link Algorithm

Form Validation. Lecture 25. Robb T. Koether. Hampden-Sydney College. Wed, Mar 23, 2018

ST512. Fall Quarter, Exam 1. Directions: Answer questions as directed. Please show work. For true/false questions, circle either true or false.

Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

One Factor Experiments

jquery Lecture 34 Robb T. Koether Wed, Apr 10, 2013 Hampden-Sydney College Robb T. Koether (Hampden-Sydney College) jquery Wed, Apr 10, / 29

The Model Stack. Lecture 8. Robb T. Koether. Hampden-Sydney College. Wed, Sep 6, 2017

Binary Tree Implementation

Triggers. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 14, 2018

Section 2.2: Covariance, Correlation, and Least Squares

Basic CSS Lecture 17

The Constructors. Lecture 7 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 1, 2017

Introduction to Databases

The Projection Matrix

Relational Databases Lecture 2

The View Frustum. Lecture 9 Sections 2.6, 5.1, 5.2. Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2011

The x86 Architecture

Inheritance: The Fundamental Functions

The Mesh Class. Lecture 23. Robb T. Koether. Hampden-Sydney College. Wed, Oct 18, 2017

Function Usage. Lecture 15 Sections 6.3, 6.4. Robb T. Koether. Hampden-Sydney College. Mon, Oct 1, 2018

MySQL Creating a Database Lecture 3

XML and AJAX Lecture 28

The x86 Instruction Set

Insertions, Deletions, and Updates

Binary Tree Implementation

Fundamental Data Types

Transcription:

The Coefficient of Determination Lecture 46 Section 13.9 Robb T. Koether Hampden-Sydney College Wed, Apr 17, 2012 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 1 / 37

Outline 1 The Regression Identity 2 Sums of Squares on the TI-83 3 TI-83 - The Coefficient of Determination 4 Assignment Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 2 / 37

Outline 1 The Regression Identity 2 Sums of Squares on the TI-83 3 TI-83 - The Coefficient of Determination 4 Assignment Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 3 / 37

Explaining the Variation in y Statisticians use regression models to explain y. More specifically, through the model they use variation in x to explain variation in y. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 4 / 37

Explaining the Variation in y For example, why do some people weigh more than other people? Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 5 / 37

Explaining the Variation in y For example, why do some people weigh more than other people? That is, why is there variability in weight? Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 5 / 37

Explaining the Variation in y For example, why do some people weigh more than other people? That is, why is there variability in weight? One explanation is that some people weigh more than others because they are taller. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 5 / 37

Explaining the Variation in y For example, why do some people weigh more than other people? That is, why is there variability in weight? One explanation is that some people weigh more than others because they are taller. That is, because there is variability in height. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 5 / 37

Explaining the Variation in y For example, why do some people weigh more than other people? That is, why is there variability in weight? One explanation is that some people weigh more than others because they are taller. That is, because there is variability in height. But that is only a partial explanation. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 5 / 37

Explaining the Variation in y Statisticians want to quantify how much of the variation in y is explained by the variation in x. We measure variation in y by the standard deviation SSY s y = n 1. However, the key component is SSY. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 6 / 37

The Regression Identity There are three different variations that we can measure. How the y values in the data deviate from their mean. How the y values in the model deviate from their mean. How the y values in the data deviate from the y values in the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 7 / 37

The Regression Identity There are three different variations that we can measure. That is, compare y to y. How the y values in the model deviate from their mean. How the y values in the data deviate from the y values in the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 7 / 37

The Regression Identity There are three different variations that we can measure. That is, compare y to y. That is, compare ŷ to y. How the y values in the data deviate from the y values in the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 7 / 37

The Regression Identity There are three different variations that we can measure. That is, compare y to y. That is, compare ŷ to y. That is, compare y to ŷ. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 7 / 37

The Regression Identity Variation in the data (Total sum of squares): SST = (y y) 2. (This is the same as SSY.) Variation in the model (Regression sum of squares): SSR = (ŷ y) 2. Residues (Sum of squared Errors): SSE = (y ŷ) 2. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 8 / 37

The Regression Identity SST is the observed variation in y. SSR is the predicted variation in y (according to the model). SSE is the unexplained variation in y (not explained by the model). Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 9 / 37

Example - SST, SSR, and SSE The following data represent the heights and weights of 10 adult males. Height (x) Weight (y) 70 185 65 140 71 180 76 220 68 150 67 170 68 185 72 200 74 210 69 160 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 10 / 37

Example - SST, SSR, and SSE The regression line is ŷ = 310 + 7x. The model predicts, for example, that if a person is 70 inches tall, he will weigh 180 pounds. The model also predicts that a person will weigh an additional 7 pounds for each additional inch of height. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 11 / 37

Example - SST, SSR, and SSE Compute the predicted weight: Y 1 (L 1 ) L 3. Height (x) Weight (y) Pred. Wgt. (ŷ) 70 185 180 65 140 145 71 180 187 76 220 222 68 150 166 67 170 159 68 185 166 72 200 194 74 210 208 69 160 173 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 12 / 37

Example - SST, SSR, and SSE 220 210 200 190 180 170 160 150 140 64 66 68 70 72 74 76 The regression line Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 13 / 37

Example - SST, SSR, and SSE 220 210 200 190 180 170 160 150 140 64 66 68 70 72 74 76 The deviations of y from y Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 13 / 37

Example - SST, SSR, and SSE 220 210 200 190 180 170 160 150 140 64 66 68 70 72 74 76 The deviations of ŷ from y Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 13 / 37

Example - SST, SSR, and SSE 220 210 200 190 180 170 160 150 140 64 66 68 70 72 74 76 The deviations of y from ŷ Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 13 / 37

Example Compute SST. x y y y (y y) 2 70 185 65 140 71 180 76 220 68 150 67 170 68 185 72 200 74 210 69 160 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 14 / 37

Example Compute SST: L 2 -y. x y y y (y y) 2 70 185 5 65 140 40 71 180 0 76 220 40 68 150 30 67 170 10 68 185 5 72 200 20 74 210 30 69 160 20 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 15 / 37

Example Compute SST: Ans 2. x y y y (y y) 2 70 185 5 25 65 140 40 1600 71 180 0 0 76 220 40 1600 68 150 30 900 67 170 10 100 68 185 5 25 72 200 20 400 74 210 30 900 69 160 20 400 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 16 / 37

Example Compute SST: sum(ans). x y y y (y y) 2 70 185 5 25 65 140 40 1600 71 180 0 0 76 220 40 1600 68 150 30 900 67 170 10 100 68 185 5 25 72 200 20 400 74 210 30 900 69 160 20 400 5950 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 17 / 37

Example Compute SSR. x y ŷ ŷ y (ŷ y) 2 70 185 65 140 71 180 76 220 68 150 67 170 68 185 72 200 74 210 69 160 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 18 / 37

Example Compute SSR: Y 1 (L 1 ) L 3. x y ŷ ŷ y (ŷ y) 2 70 185 180 65 140 145 71 180 187 76 220 222 68 150 166 67 170 159 68 185 166 72 200 194 74 210 208 69 160 173 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 19 / 37

Example Compute SSR: L 3 -y. x y ŷ ŷ y (ŷ y) 2 70 185 180 0 65 140 145 35 71 180 187 7 76 220 222 42 68 150 166 14 67 170 159 21 68 185 166 14 72 200 194 14 74 210 208 28 69 160 173 7 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 20 / 37

Example Compute SSR: Ans 2. x y ŷ ŷ y (ŷ y) 2 70 185 180 0 0 65 140 145 35 1225 71 180 187 7 49 76 220 222 42 1764 68 150 166 14 196 67 170 159 21 441 68 185 166 14 196 72 200 194 14 196 74 210 208 28 784 69 160 173 7 49 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 21 / 37

Example Compute SSR: sum(ans). x y ŷ ŷ y (ŷ y) 2 70 185 180 0 0 65 140 145 35 1225 71 180 187 7 49 76 220 222 42 1764 68 150 166 14 196 67 170 159 21 441 68 185 166 14 196 72 200 194 14 196 74 210 208 28 784 69 160 173 7 49 4900 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 22 / 37

Example Compute SSE. x y ŷ y ŷ (y ŷ) 2 70 185 65 140 71 180 76 220 68 150 67 170 68 185 72 200 74 210 69 160 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 23 / 37

Example Compute SSE: Y 1 (L 1 ) L 3. x y ŷ y ŷ (y ŷ) 2 70 185 180 65 140 145 71 180 187 76 220 222 68 150 166 67 170 159 68 185 166 72 200 194 74 210 208 69 160 173 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 24 / 37

Example Compute SSE: L 2 -L 3 L 4. x y ŷ y ŷ (y ŷ) 2 70 185 180 5 65 140 145 5 71 180 187 7 76 220 222 2 68 150 166 16 67 170 159 11 68 185 166 19 72 200 194 6 74 210 208 7 69 160 173 13 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 25 / 37

Example Compute SSE: Ans 2. x y ŷ y ŷ (y ŷ) 2 70 185 180 5 25 65 140 145 5 25 71 180 187 7 49 76 220 222 2 4 68 150 166 16 256 67 170 159 11 121 68 185 166 19 361 72 200 194 6 36 74 210 208 7 49 69 160 173 13 169 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 26 / 37

Example Compute SSE: sum(ans). x y ŷ y ŷ (y ŷ) 2 70 185 180 5 25 65 140 145 5 25 71 180 187 7 49 76 220 222 2 4 68 150 166 16 256 67 170 159 11 121 68 185 166 19 361 72 200 194 6 36 74 210 208 7 49 69 160 173 13 169 1050 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 27 / 37

Example We have now found that SSR = 4900. SSE = 1050. SST = 5950. We see that SSR + SSE = SST. This is called the regression identity. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 28 / 37

Explaining Variation It follows that the total variation in y (SST) can be separated into two parts: SSR = the part explained by the model. SSE = the part unexplained by the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 29 / 37

Explaining Variation Furthermore, 1 = SSR SST + SSE SST. So, the fraction SSR SST can be interpreted as the proportion of SST that is explained by the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 30 / 37

Outline 1 The Regression Identity 2 Sums of Squares on the TI-83 3 TI-83 - The Coefficient of Determination 4 Assignment Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 31 / 37

TI-83 - Finding SSR, SSE, and SST TI-83 SSR, SSE, and SST Put the x values into L 1 and the y values into L 2. Use LinReg(a+bx) L 1,L 2,Y 1. Enter Y 1 (L 1 ) L 3. To get SSR, evaluate sum((l 3 -y) 2 ). To get SSE, evaluate sum((l 2 -L 3 ) 2 ). To get SST, evaluate sum((l 2 -y) 2 ). Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 32 / 37

Explaining Variation It can be shown that and, therefore, r 2 = SSR SST 1 r 2 = SSE SST. Therefore, r 2 is the proportion of variation in y that is explained by the model. It is called the coefficient of determination. 1 r 2 is the proportion that is not explained by the model. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 33 / 37

Outline 1 The Regression Identity 2 Sums of Squares on the TI-83 3 TI-83 - The Coefficient of Determination 4 Assignment Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 34 / 37

TI-83 - Coefficient of Determination TI-83 Coefficient of Determination To calculate r 2 on the TI-83, follow the procedure that produces the regression line and r. In the same window, the TI-83 reports the value of r 2. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 35 / 37

Coefficient of Determination Example (Coefficient of Determination) In the height-weight example, we found that r = 0.9075. Then r 2 = 0.8235. So, 82% of variation in weight can be explained by variation in height. The remaining 18% of variation in weight is due to some other factor. Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 36 / 37

Outline 1 The Regression Identity 2 Sums of Squares on the TI-83 3 TI-83 - The Coefficient of Determination 4 Assignment Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 37 / 37

Assignment Homework Read Section 13.9, pages 868-869. Exercises 35(a), 36(f), Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17, 2012 38 / 37