Math 1710 Class 20. V2u. Last Time. Graphs and Association. Correlation. Regression. Association, Correlation, Regression Dr. Back. Oct.

Similar documents
Dr. Allen Back. Sep. 23, 2016

Lecture 16 - Correlation and Regression

Oct Simple linear regression. Minimum mean square error prediction. Univariate. regression. Calculating intercept and slope

STAT5044: Regression and Anova. Inyoung Kim

9. Linear Regression and Correlation

Lecture 3. The Population Variance. The population variance, denoted σ 2, is the sum. of the squared deviations about the population

Chapter 7. Scatterplots, Association, and Correlation

MATH 1070 Introductory Statistics Lecture notes Relationships: Correlation and Simple Regression

Chapter 6: Exploring Data: Relationships Lesson Plan

Unit 6 - Introduction to linear regression

Unit 6 - Simple linear regression

7.0 Lesson Plan. Regression. Residuals

The Simple Regression Model. Part II. The Simple Regression Model

Correlation. A statistics method to measure the relationship between two variables. Three characteristics

A company recorded the commuting distance in miles and number of absences in days for a group of its employees over the course of a year.

Simple Linear Regression for the MPG Data

Can you tell the relationship between students SAT scores and their college grades?

Section Least Squares Regression

HOLLOMAN S AP STATISTICS BVD CHAPTER 08, PAGE 1 OF 11. Figure 1 - Variation in the Response Variable

Chapter 16: Understanding Relationships Numerical Data

Chapter 4 Describing the Relation between Two Variables

Regression and correlation. Correlation & Regression, I. Regression & correlation. Regression vs. correlation. Involve bivariate, paired data, X & Y

Lecture 18: Simple Linear Regression

Linear Regression and Correlation. February 11, 2009

Chapter 16. Simple Linear Regression and dcorrelation

SLR output RLS. Refer to slr (code) on the Lecture Page of the class website.

Mathematics for Economics MA course

Basics of Experimental Design. Review of Statistics. Basic Study. Experimental Design. When an Experiment is Not Possible. Studying Relations

Sociology 6Z03 Review I

Announcements. Lecture 10: Relationship between Measurement Variables. Poverty vs. HS graduate rate. Response vs. explanatory

Announcements: You can turn in homework until 6pm, slot on wall across from 2202 Bren. Make sure you use the correct slot! (Stats 8, closest to wall)

Chapter 7. Linear Regression (Pt. 1) 7.1 Introduction. 7.2 The Least-Squares Regression Line

Inference for Regression Inference about the Regression Model and Using the Regression Line, with Details. Section 10.1, 2, 3

15.0 Linear Regression

27. SIMPLE LINEAR REGRESSION II

Lectures on Simple Linear Regression Stat 431, Summer 2012

Is a measure of the strength and direction of a linear relationship

Announcements. Unit 6: Simple Linear Regression Lecture : Introduction to SLR. Poverty vs. HS graduate rate. Modeling numerical variables

AP Statistics L I N E A R R E G R E S S I O N C H A P 7

Introduction and Single Predictor Regression. Correlation

Y i = η + ɛ i, i = 1,...,n.

Test 3A AP Statistics Name:

Summarizing Data: Paired Quantitative Data

Relationship Between Interval and/or Ratio Variables: Correlation & Regression. Sorana D. BOLBOACĂ

Chi-square tests. Unit 6: Simple Linear Regression Lecture 1: Introduction to SLR. Statistics 101. Poverty vs. HS graduate rate

Statistical View of Least Squares

Chapter 3: Describing Relationships

MATH 1150 Chapter 2 Notation and Terminology

Related Example on Page(s) R , 148 R , 148 R , 156, 157 R3.1, R3.2. Activity on 152, , 190.

ES-2 Lecture: More Least-squares Fitting. Spring 2017

Chapter 3: Describing Relationships

L21: Chapter 12: Linear regression

11 Correlation and Regression

Simple Linear Regression Analysis

Chapter 5 Friday, May 21st

401 Review. 6. Power analysis for one/two-sample hypothesis tests and for correlation analysis.

MATH 1015: Life Science Statistics. Lecture Pack for Chapter 1 Weeks 1-3. Lecturer: Jennifer Chan Room: Carslaw Room 817 Telephone:

AP Statistics Unit 6 Note Packet Linear Regression. Scatterplots and Correlation

Lecture 15: Chapter 10

Business Statistics. Lecture 9: Simple Regression

Simple Linear Regression

Scatter plot of data from the study. Linear Regression

BIOSTATISTICS NURS 3324

Data Analysis 1 LINEAR REGRESSION. Chapter 03

ECON 450 Development Economics

Bivariate Data Summary

Scatterplots. STAT22000 Autumn 2013 Lecture 4. What to Look in a Scatter Plot? Form of an Association

Chapter 14. Linear least squares

Linear Regression. Linear Regression. Linear Regression. Did You Mean Association Or Correlation?

IF YOU HAVE DATA VALUES:

Simple Linear Regression Using Ordinary Least Squares

STATS DOESN T SUCK! ~ CHAPTER 16

Regression. X (b) Line of Regression. (a) Curve of Regression. Figure Regression lines

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

Lecture 17. Ingo Ruczinski. October 26, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University

AMS 7 Correlation and Regression Lecture 8

Correlation Analysis

appstats8.notebook October 11, 2016

Lecture 11: Simple Linear Regression

Lecture notes to Stock and Watson chapter 4

The response variable depends on the explanatory variable.

AP Statistics Two-Variable Data Analysis

The following formulas related to this topic are provided on the formula sheet:

Chapter 16. Simple Linear Regression and Correlation

Scatter plot of data from the study. Linear Regression

ECON The Simple Regression Model

MODELING. Simple Linear Regression. Want More Stats??? Crickets and Temperature. Crickets and Temperature 4/16/2015. Linear Model

Weighted Least Squares

MATH 2560 C F03 Elementary Statistics I LECTURE 9: Least-Squares Regression Line and Equation

ECON 497: Lecture 4 Page 1 of 1

Interactions. Interactions. Lectures 1 & 2. Linear Relationships. y = a + bx. Slope. Intercept

Lab 3 A Quick Introduction to Multiple Linear Regression Psychology The Multiple Linear Regression Model

y n 1 ( x i x )( y y i n 1 i y 2

Lecture 3: Multiple Regression

Mrs. Poyner/Mr. Page Chapter 3 page 1

Analysis of Bivariate Data

Section 3: Simple Linear Regression

Statistical View of Least Squares

+ Statistical Methods in

Describing Bivariate Relationships

Transcription:

,, Dr. Back Oct. 14, 2009

Son s Heights from Their Fathers Galton s Original 1886 Data

If you know a father s height, what can you say about his son s? Son s Heights from Their Fathers Galton s Original 1886 Data

Son s Heights from Their Fathers If you know a father s height, what can you say about his son s? > hts V2 V3 1 65.04851 59.77827 2 63.25094 63.21404 3 64.95532 63.34242 4 65.75250 62.79238 5 61.13723 64.28113 6 63.02254 64.24221 7 65.37053 64.08231 8 64.72398 63.99574 9 66.06509 64.61338 10 66.96738 63.97944.........

Son s Heights from Their Fathers If you know a father s height, what can you say about his son s? >summary(hts$v3) (Sons) Min. 1stQu. Median Mean 3rdQu. Max. 58.51 66.93 68.62 68.68 70.47 78.36 >summary(hts$v2) (Fathers) Min. 1stQu. Median Mean 3rdQu. Max. 59.01 65.79 67.77 67.69 69.60 75.43

Son s Heights from Their Fathers If you know a father s height, what can you say about his son s? >summary(hts$v3) (Sons) Min. 1stQu. Median Mean 3rdQu. Max. 58.51 66.93 68.62 68.68 70.47 78.36 >summary(hts$v2) (Fathers) > sd(hts$v3) [1] 2.814702 > sd(hts$v2) [1] 2.744868 Min. 1stQu. Median Mean 3rdQu. Max. 59.01 65.79 67.77 67.69 69.60 75.43

Son s Heights from Their Fathers If you know a father s height, what can you say about his son s? >summary(hts$v3) (Sons) Min. 1stQu. Median Mean 3rdQu. Max. 58.51 66.93 68.62 68.68 70.47 78.36 >summary(hts$v2) (Fathers) Min. 1stQu. Median Mean 3rdQu. Max. 59.01 65.79 67.77 67.69 69.60 75.43 > cor(hts$v3, hts$v2) [1] 0.5013383

Son s Heights from Their Fathers Galton Data with Line of

Son s Heights from Their Fathers Suppose y = height son were linearly related to x = height father by y = β 1 x + β 0.

Son s Heights from Their Fathers Suppose y = height son were linearly related to x = height father by y = β 1 x + β 0. We d then have ȳ = β 1 x + β 0 as well and (y ȳ) = β 1 (x x).

Son s Heights from Their Fathers Suppose y = height son were linearly related to x = height father by y = β 1 x + β 0. We d then have ȳ = β 1 x + β 0 as well and (y ȳ) = β 1 (x x). Furthermore, the slope β 1 would be the ratio of standard deviations: β 1 = s son s father

Son s Heights from Their Fathers Galton Data with line of slope s son s father added in blue.

Son s Heights from Their Fathers The fact that the red best fitting line (termed the line of regression) actually has less slope than the blue line is one form of Galton s regression to the mean. Tall fathers tend to have tall sons, but the sons are typically not as extreme in their tallness as their fathers were.

Son s Heights from Their Fathers The fact that the red best fitting line (termed the line of regression) actually has less slope than the blue line is one form of Galton s regression to the mean. Tall fathers tend to have tall sons, but the sons are typically not as extreme in their tallness as their fathers were. In modern terms, we see two usages of the word regression here.

Son s Heights from Their Fathers Galton Data with Other Line of in pink: (predict father s height from son s)

Given: paired data (x 1, y 1 ),..., (x n, y n )

Given: paired data (x 1, y 1 ),..., (x n, y n ) Scatterplot: Plot x horizontally, y vertically.

Given: paired data (x 1, y 1 ),..., (x n, y n ) If one variable is potentially explanatory for the response of the other, choose the explanatory variable as x.

Given: paired data (x 1, y 1 ),..., (x n, y n ) is what we care about. If we know the x value of a point, does it tell us something about the likely y value?

Given: paired data (x 1, y 1 ),..., (x n, y n ) is what we care about. If we know the x value of a point, does it tell us something about the likely y value? (a number) and regression (a line) are just techniques to study association.

Given: paired data (x 1, y 1 ),..., (x n, y n ) Principal Aspects of : Direction: Strength: Form:

Given: paired data (x 1, y 1 ),..., (x n, y n ) Principal Aspects of : Direction: positive or negative Strength: Form:

Given: paired data (x 1, y 1 ),..., (x n, y n ) Principal Aspects of : Direction: positive or negative Strength: Form: Negative means as x increases, y generally decreases.

Given: paired data (x 1, y 1 ),..., (x n, y n ) Principal Aspects of : Direction: Strength: strong, moderate, or weak Form:

Given: paired data (x 1, y 1 ),..., (x n, y n ) Principal Aspects of : Direction: Strength: Form: linear, curved, or clustered

Examples Example b

Examples Example b My call: Direction: positive Strength: moderate Form: curved

Examples Example b using Data Desk

Examples Example c

Examples Example c My call: Direction: negative Strength: strong Form: linear

Examples Example d

Examples Example d My call: Direction: negative Strength: moderate Form: (perhaps some outliers)

Examples Example d using Data Desk

Examples Example e

Examples Example e My call: Direction: positive Strength: strong Form: linear

Examples Example f

Examples Example f My call: Direction: negative Strength: weak Form: curved, maybe an outlier

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y Positive association means as x increases, so does y (And similarly when x decreases.)

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ Positive association means as x increases, so does y (And similarly when x decreases.) So for pos. association, most terms in the sum are either (+) (+) or ( ) ( ). s y

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ Positive association means as x increases, so does y (And similarly when x decreases.) So for pos. association, most terms in the sum are either (+) (+) or ( ) ( ). Thus with pos. association, r tends to be positive. s y

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y pos r pos. association neg. r neg. association

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y 1 <= r <= 1 (= ±1 only for perfect linear association)

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y 1 <= r <= 1 (= ±1 only for perfect linear association)

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y 1 <= r <= 1 (= ±1 only for perfect linear association) To see = ±1 for perfect linear association y = β 1 x + β 0 means s y = β 1 s x and ȳ = β 1 x + β 0.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ To see = ±1 for perfect linear association y = β 1 x + β 0 means s y = β 1 s x and ȳ = β 1 x + β 0. r = 1 ( ) ( ) n 1 Σ xi x yi ȳ s x s y = 1 ( ) ( ) n 1 Σ xi x xi x β 1 = 1 n 1 Σ s x ( xi x s x ) 2 β 1 β 1 s y β 1 s x = β 1 β 1 where the last line used the definition of the variance.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ If you ve studied vectors, the fact 1 <= r <= 1 comes from the same mathematics which explains why s y cos θ = v w v w has right hand side between 1 and +1.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y r is unchanged if x and y are exchanged.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y invariant under rescaling

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y Curved association and r=0 are consistent!

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ Curved association and r=0 are consistent! Five points along y = x 2. ( x = 0 and ȳ = 2.) s y x y (x-0) (y-2) (x-0)(y-2) 0 0 0-2 0 1 1 1-1 -1-1 1-1 -1 1 2 4 2 2 4-2 4-2 2-4

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ Curved association and r=0 are consistent! Five points along y = x 2. ( x = 0 and ȳ = 2.) s y x y (x-0) (y-2) (x-0)(y-2) 0 0 0-2 0 1 1 1-1 -1-1 1-1 -1 1 2 4 2 2 4-2 4-2 2-4 r is exactly zero even though the association is very strong.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y r is strongly affected by outliers.

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y samples from independent RV s r 0

Properties r = 1 ( n 1 Σ xi x s x ) ( ) yi ȳ s y X,Y indep std normal RV s ; set Y = ρx + 1 ρ 2 Y Then (X, Y ) will tend to generate data with r ρ. (e.g. ρ =.99 (1 ρ => 2 ) ρ =.14!)

What does Best Fitting Mean? Given any point (x i, y i )

What does Best Fitting Mean? Given any point (x i, y i ) and any line y = c 0 + c 1 x

What does Best Fitting Mean? Given any point (x i, y i ) and any line y = c 0 + c 1 x we can use the line to get a predicted value ŷ i = c 0 + c 1 x i

What does Best Fitting Mean? Given any point (x i, y i ) and any line y = c 0 + c 1 x we can use the line to get a predicted value and define the residual d i by ŷ i = c 0 + c 1 x i d i = y i ŷ i.

What does Best Fitting Mean? Best fitting means the line minimizing the sum Σdi 2 squares of the vertical distances. of the

What does Best Fitting Mean? Best fitting means the line minimizing the sum Σdi 2 of the squares of the vertical distances. Answer: We ll show the best fitting line ŷ = b 1 x + b 0 is given by ( ) sy b 1 = r s x

What does Best Fitting Mean? Best fitting means the line minimizing the sum Σdi 2 of the squares of the vertical distances. Answer: We ll show the best fitting line ŷ = b 1 x + b 0 is given by ( ) sy b 1 = r i.e.: Slope is r in standard deviation units. And b 0 = ȳ b 1 x i.e.: The point ( x, ȳ) lies on the line. s x

What does Best Fitting Mean? Strictly speaking, the word residual refers to this vertical distance d i JUST in the case that the line is the answer line ŷ = b 0 + b 1 x.