Correlation and Simple Regression

Similar documents
Section 14 Simple Linear Regression: Introduction to Least Squares Regression

Module 3: Correlation and Covariance

Chapter 10. Key Ideas Correlation, Correlation Coefficient (r),

Exercise 1.12 (Pg )

Chapter 13 Introduction to Linear Regression and Correlation Analysis

Relationships Between Two Variables: Scatterplots and Correlation

Chapter 7: Simple linear regression Learning Objectives

Session 7 Bivariate Data and Analysis

2. Simple Linear Regression

The Big Picture. Correlation. Scatter Plots. Data

CALCULATIONS & STATISTICS

AP STATISTICS REVIEW (YMS Chapters 1-8)

Simple Regression Theory II 2010 Samuel L. Baker

Elementary Statistics Sample Exam #3

17. SIMPLE LINEAR REGRESSION II

1) Write the following as an algebraic expression using x as the variable: Triple a number subtracted from the number

Outline. Topic 4 - Analysis of Variance Approach to Regression. Partitioning Sums of Squares. Total Sum of Squares. Partitioning sums of squares

" Y. Notation and Equations for Regression Lecture 11/4. Notation:

Simple linear regression

Correlation and Regression

Algebra Academic Content Standards Grade Eight and Grade Nine Ohio. Grade Eight. Number, Number Sense and Operations Standard

COMP6053 lecture: Relationship between two variables: correlation, covariance and r-squared.

Lecture 11: Chapter 5, Section 3 Relationships between Two Quantitative Variables; Correlation

Pearson s Correlation

CORRELATION ANALYSIS

Correlation key concepts:

Algebra 1 Course Information

Means, standard deviations and. and standard errors

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Descriptive Statistics

Time series Forecasting using Holt-Winters Exponential Smoothing

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

Univariate Regression

Descriptive Statistics and Measurement Scales

STAT 350 Practice Final Exam Solution (Spring 2015)

A Primer on Mathematical Statistics and Univariate Distributions; The Normal Distribution; The GLM with the Normal Distribution

The correlation coefficient

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

Linear Regression. Chapter 5. Prediction via Regression Line Number of new birds and Percent returning. Least Squares

2. Linear regression with multiple regressors

Simple Predictive Analytics Curtis Seare

2) The three categories of forecasting models are time series, quantitative, and qualitative. 2)

Notes on Applied Linear Regression

5.1 Radical Notation and Rational Exponents

table to see that the probability is (b) What is the probability that x is between 16 and 60? The z-scores for 16 and 60 are: = 1.

Section 3 Part 1. Relationships between two numerical variables

2. Here is a small part of a data set that describes the fuel economy (in miles per gallon) of 2006 model motor vehicles.

Outline: Demand Forecasting

Statistiek II. John Nerbonne. October 1, Dept of Information Science

Module 5: Multiple Regression Analysis

Section 1: Simple Linear Regression

Chapter 1 Lecture Notes: Science and Measurements

Business Statistics. Successful completion of Introductory and/or Intermediate Algebra courses is recommended before taking Business Statistics.

Name: Date: Use the following to answer questions 2-3:

Correlation. What Is Correlation? Perfect Correlation. Perfect Correlation. Greg C Elvers

South Carolina College- and Career-Ready (SCCCR) Probability and Statistics

CHAPTER 13 SIMPLE LINEAR REGRESSION. Opening Example. Simple Regression. Linear Regression

Algebra I Vocabulary Cards

5. Multiple regression

Final Exam Practice Problem Answers

HYPOTHESIS TESTING: CONFIDENCE INTERVALS, T-TESTS, ANOVAS, AND REGRESSION

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Covariance and Correlation

The Effect of Dropping a Ball from Different Heights on the Number of Times the Ball Bounces

Characteristics of Binomial Distributions

Lean Six Sigma Analyze Phase Introduction. TECH QUALITY and PRODUCTIVITY in INDUSTRY and TECHNOLOGY

Algebra 1 Course Title

Correlation Coefficient The correlation coefficient is a summary statistic that describes the linear relationship between two numerical variables 2

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

Pie Charts. proportion of ice-cream flavors sold annually by a given brand. AMS-5: Statistics. Cherry. Cherry. Blueberry. Blueberry. Apple.

LAGUARDIA COMMUNITY COLLEGE CITY UNIVERSITY OF NEW YORK DEPARTMENT OF MATHEMATICS, ENGINEERING, AND COMPUTER SCIENCE

4. Multiple Regression in Practice

Biostatistics: DESCRIPTIVE STATISTICS: 2, VARIABILITY

Section A. Index. Section A. Planning, Budgeting and Forecasting Section A.2 Forecasting techniques Page 1 of 11. EduPristine CMA - Part I

Course Text. Required Computing Software. Course Description. Course Objectives. StraighterLine. Business Statistics

6.4 Normal Distribution

Experiment #1, Analyze Data using Excel, Calculator and Graphs.

Econometrics Simple Linear Regression

8. Time Series and Prediction

with functions, expressions and equations which follow in units 3 and 4.

Concepts in Investments Risks and Returns (Relevant to PBE Paper II Management Accounting and Finance)

5. Linear Regression

CORRELATIONAL ANALYSIS: PEARSON S r Purpose of correlational analysis The purpose of performing a correlational analysis: To discover whether there

The Point-Slope Form

Simple Linear Regression, Scatterplots, and Bivariate Correlation

A.2. Exponents and Radicals. Integer Exponents. What you should learn. Exponential Notation. Why you should learn it. Properties of Exponents

Descriptive statistics Statistical inference statistical inference, statistical induction and inferential statistics

Physics Lab Report Guidelines

Association Between Variables

Example: Boats and Manatees

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

Coefficient of Determination

Premaster Statistics Tutorial 4 Full solutions

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

How To Run Statistical Tests in Excel

11. Analysis of Case-control Studies Logistic Regression

Zero: If P is a polynomial and if c is a number such that P (c) = 0 then c is a zero of P.

Bungee Constant per Unit Length & Bungees in Parallel. Skipping school to bungee jump will get you suspended.

MTH 140 Statistics Videos

Polynomial and Rational Functions

Transcription:

Correlation and Simple Regression Alan B. Gelder 06E:071, The University of Iowa 1 1 Correlation Categorical vs. Quantitative Variables: We have seen both categorical and quantitative variables during this course. For instance, χ 2 problems are all about comparing two categorical variables with each other to see if they have a relationship. Proportions problems deal with categorical variables that only have two possible categories (such as yes and no; agree or disagree; male or female; students and non-students; etc.). Categorical data may be graphed using bar graphs, but we cannot plot points on an axis with categorical data. Quantitative variables, on the other hand, can be plotted on an axis. Means problems all rely on quantitative variables (we can add the observations together and take averages). Correlation compares quantitative variables with quantitative variables. What correlation measures: Correlation is a measure of the strength and direction of a linear relationship between two quantitative variables. Strength indicates how closely related the variables are. Direction implies whether there is a positive or a negative relationship between the variables. (Draw pictures to illustrate different strengths and directional relationships between variables.) What correlation does not measure: Two quantitative variables may indeed have a very strong relationship, but the correlation may suggest that the relationship between the variables is weak at best. An important thing to remember is that correlation measures the linear relationship between quantitative variables. Correlation does not appropriately capture parabolic, exponential, or other non-linear relationships. The formula for measuring correlation is the following: r = 1 n 1 ( ) ( ) xi x yi ȳ Intuition for the formula: When we have two quantitative variables we can make a scatterplot of the points. The formula for correlation identifies how far the 1 The notes for this class follow the general format of Blake Whitten s lecture notes for the same course. s y 1

x component of each point is from the mean of the x s. It also identifies how far the y component of each point is from the mean of the y s. The formula does something more, however. In order to create a unitless measure of the relationship between two variables, the difference between x i and x is normalized by. We also do the same thing for y. (Draw a picture to break down the different pieces of the correlation formula.) Positive and negative correlation contributions: An observation (x i, y i ) has a positive correlation contribution if ( ) ( ) xi x yi ȳ > 0 Likewise, an observation has a negative correlation contribution if ( ) ( ) xi x yi ȳ < 0 (Draw a picture indicating the locations for positive and negative correlation contributions.) Properties of r: 1. Range: 1 r 1. Positive values of r indicate a positive correlation. Negative values of r indicate a negative correlation. r = 0 indicates no correlation. 2. r is unitless. The correlation is unaffected by changes from feet to meters or from gallons to liters. Correlation vs. causation: Just because two variables have a strong relationship does not necessarily mean that one of the variables causes the other variable. Correlation simply identifies a relationship between variables, while causation deals with the sequence of two variables: a change in one variable leads to a change in another variable. For example, during the polio epidemic in the first half of the twentieth century people observed that the number of polio cases was especially high during the summer. (Since season is a categorical variable, we can use temperature instead.) An idea began to spread that the outbreak of polio in the summer was due to all of the ice cream that children were eating in the summer (the underlying idea being that eating more sugar caused people to be more susceptible to contracting polio). Well, even though ice cream is quite popular during the summer months, in hindsight it s y s y 2

appears that ice cream was not the culprit behind the polio outbreaks. Lurking variable: Sometimes it is difficult to identify which variable is truly causing a change in another variable (like what caused the polio outbreak). Such hidden variables are sometimes referred to as lurking variables. 1.1 Example Lean Body Mass and Metabolic Rate [This example is adapted from Exercise 2.8 in the text] Lean body mass is defined as a person s mass without any fat (i.e. muscles, bones, fluids, organs, skin, etc. without any fat). Researchers are interested in the relationship between the human body s lean body mass and its resting metabolic rate (how many calories a person burns per day without any strenuous exercise). The data for 10 subjects is shown below: Subject Mass (kg) Metabolic Rate (cal) 1 62.0 1792 2 62.9 1666 3 36.1 995 4 54.6 1425 5 48.5 1396 6 42.0 1418 7 47.4 1362 8 50.6 1502 9 42.0 1256 10 48.7 1614 With correlation it does not matter which variable you assign to be x and which variable you assign to be y (although, it will matter for regression). For now, let mass be the x variable, and let metabolic rate be the y variable. From your calculator or Minitab you can find x,, ȳ, and s y : x = 49.48 = 8.57 ȳ = 1442.6 s y = 223.5 We now need to calculate the standardized distance between the x component of 3

each observation and x, as well as the standardized distance between the y component of each observation and ȳ. For the first observation, this is shown as follows: x 1 x = y 1 ȳ = s y 62.0 49.48 8.57 = 1.4609 1792 1442.6 = 1.5633 223.5 We can then multiply these standardized distances together to get the contribution that the first observation makes to the correlation: 1.4609 1.5633 = 2.2838 The standardized distances and correlation contributions are summarized in the table below: Subject x y stand. x stand. y contribution 1 62.0 1792 1.4609 1.5633 2.2838 2 62.9 1666 1.5659 0.9996 1.5653 3 36.1 995-1.5613-2.0027 3.1268 4 54.6 1425 0.5974-0.0788-0.0471 5 48.5 1396-0.1144-0.2085 0.0239 6 42.0 1418-0.8728-0.1101 0.0961 7 47.4 1362-0.2427-0.3606 0.0875 8 50.6 1502 0.1307 0.2658 0.0347 9 42.0 1256-0.8728-0.8349 0.7287 10 48.7 1614-0.09102 0.7669-0.0698 We can now calculate the correlation by summing the contributions of the different subjects and dividing by n 1: r = 1 7.8299 (2.2838 + 1.5653 + + 0.0698) = = 0.8700 10 1 9 Follow-up question: Now suppose that three more subjects have been added to the study (in addition to the individuals that were already in the study). The data for these individuals is as follows: Subject Mass (kg) Metabolic Rate (cal) 11 40.3 1189 12 33.1 913 13 51.9 1460 4

What would we need to do to include these observations in our measure of the correlation between lean body mass and resting metabolic rate? Calculator note: In addition to the long hand calculation of the correlation, you should become familiar with how to enter data on your calculator and have it produce the correlation for you. Take some time to review how to find the correlation on your calculator. 2 You should also become familiar with how to do simple regression on your calculator. 2 Simple Linear Regression Simple linear regression takes data from a predictor variable x and a response variable y and attempts to find the best possible line to describe the relationship between the x and y variables. As such, we will use the basic slope-intercept equation for a line to model our regression results. Parameters: The population parameters that we will attempt to estimate and try to make inference about are the intercept β 0 and the slope β 1 of our line. The population regression line is given by y i = β 0 + β 1 x i + ε i The ε i indicates that the regression line does not fit every data point perfectly there is some error ε i that the i th data point may have from being exactly equal to the regression line. However, while there may be some error for individual data points, on average, the population regression line will precisely capture the linear relationship between x and y: µ y = β 0 + β 1 x Statistics: Given our data, we will make estimates for the intercept and slope of our line. These are denoted b 0 and b 1, respectively. 3 The sample or estimated regression equation is ŷ i = b 0 + b 1 x i Note that the sample regression equation has ŷ while the population regression equation has y. The difference between these is that y is what we actually observe, 2 The calculator help website is a helpful resource: http://www.users.muohio.edu/kuiperc/calculatorhelp/index.html 3 Another common notation for the estimate of the intercept is ˆβ 0. Similarly, the estimate of the slope may be denoted ˆβ 1. 5

and ŷ is what we predict will happen given x. Response and predictor: There are special names for the x and the y variables in regression. The x variable is called the predictor variable since we use it to predict what y will be. The y variable, on the other hand, is called the response variable because it is the output of the regression equation: we put x into the regression equation and it gives us y. Simple regression: The simple part of the simple linear regression specifically refers to the case where we have one predictor variable x and one response variable y. Multiple regression, which we will study in the future, allows for several predictor variables (x 1, x 2,..., x n ) and one response variable y. Example 1: Obtain and plot the regression equation describing how lean body mass predicts a person s resting metabolic rate. This can be done in Minitab with a fitted line plot. Least-Squares Regression: How do we come up with estimates for the slope and intercept of our equation? (Illustrate with a picture.) Fundamentally, we want to have our predicted values of y (ŷ) to be as close as possible to our actual values of y. The difference between y and ŷ is called the error. For a specific data point i, the error is e i = y i ŷ i Some points will have negative errors ( y i < ŷ i over-prediction), and some points will have positive errors (y i > ŷ i under-prediction). Our goal is to minimize the sum total of all of the errors for i = 1, 2,..., n. However, in order to avoid having the negative errors cancel out the positive errors, we will square the errors so that they are all positive. Hence, we want to find the slope and the intercept which minimize the sum of the squared errors. That is, we want to find b 0 and b 1 which minimize the following: SSE = e 2 i = (y i ŷ i ) 2 = (y i [b 0 + b 1 x i ]) 2 The solution to this problem is obtained by differentiating with respect to b 0 and b 1. Slope formula: b 1 = r s y 6

Intercept formula: b 0 = ȳ b 1 x Interpretation of b 1 : Remember that the slope is the rise over the run, or rather y/ x. That said, if x increases by one standard deviation ( ), then y increases by r standard deviations. Here, units matter: Another thing that can be seen from the formula for b 1 is that units matter. While the correlation coefficient r is not sensitive to changes in units, s y and do depend on their underlying units. Changing from dollars to yen or from miles to kilometers will change the regression equation. Example 2: Using the formulas for b 0 and b 1, obtain the regression equation describing how lean body mass predicts a person s resting metabolic rate (using the original 10 observations). Also, interpret the slope coefficient. Example 3: Use your calculator to obtain the regression equation describing how lean body mass predicts a person s resting metabolic rate (using all 13 observations). How much does regression help us to predict y? The goal of regression is to take advantage of any information contained in x in order to better predict y. In order to quantify how much predictive power regression provides us, consider the extreme case where x and y are completely unrelated. Then knowing x would not help us at all in predicting y. If x and y are truly unrelated, then our sample average of y (ȳ) would be our best tool for predicting y. So if ŷ = ȳ, how much variation do we have? (Draw a picture showing SST.) y i ŷ i = y i ȳ SST = Sum of Squares Total = (y i ȳ) 2 Now suppose that x and y are linearly related (either strongly or weakly, the point is that they are related). Then knowing x is going to give us some information about y. Using regression, we can obtain an improved prediction of y which is conditioned on x. Yet, even using regression, we will likely only be able to account for a portion of the variation in our baseline case (SST). The total amount of variation in y that we are able to explain with regression is called SSR, or the sum of squares explained by regression. SSR is equal to the total variation in y minus the amount of variation 7

that is leftover after regression. This leftover variation is the SSE that we did our best to minimize in making the regression equation. (Draw a picture showing SSE.) Hence, SSR = SST SSE The added help that regression provides us is measured by the fraction of the total variation in y that can be explained by the regression. That is R 2 = SSR SST = SST SSE SST Interpretation: R 2 can be interpreted as the percent of the variation in y that is explained by x. If the regression is able to explain all of the variation in the y variable, then SSR = SST, so R 2 = 1. If, however, the regression is not able to explain any of the variation in y, then SSR = 0, and R 2 = 0. So 0 R 2 1. Connection to correlation: In simple regression, R 2 = r 2 where r is the correlation between x and y. Note that while 1 r 1, R 2 is always between 0 and 1. How high should R 2 be? The more closely related two variables are, the higher the R 2 will be. So how high does the R 2 need to be in order to for there to be a strong relationship between two variables? It really depends on what type of data we are working with. If we are doing a physics experiment, then a good statistical model of our data will likely have an R 2 that is really close to 1 (probably between 0.85 and 1.0). We would expect this because the laws of physics (aside from quantum mechanics) are fairly predictable. Suppose instead that we are doing research in economics, psychology, political science, or another one of the social sciences. Since people do not behave as predictably as the laws of physics, there is going to be a lot more variation. Our regression model will only be able to capture the basic pattern of what is going on, so a really good model may have a fairly small R 2. There are situations where an R 2 as high as 0.3 or 0.4 may be considered stellar. Example 4: Find and interpret R 2 for the regression describing how lean body mass predicts a person s resting metabolic rate. Also identify the SSR, SSE, and the SST. What relationship do these terms have to ANOVA? Another measure of a regression s effectiveness: In addition to R 2, there is another statistic that is commonly provided in the regression output of statistical software which can be used in tandem with R 2 to judge the effectiveness of the regression. The standard error of the regression S measures the dispersion of the 8

errors that are leftover after regression. The smaller S is, the more effective the regression is. S is the square root of the regression variance of y, which differs from the traditional sample variance. The formulas for the regression variance and the sample variance of y are shown below: Regression variance of y: s 2 = n (y i ŷ i ) 2 n 2 = SSE n 2 = MSE Regular sample variance of y: s 2 y = n (y i ȳ) 2 n 1 = SST n 1 Degrees of freedom: For the regular sample variance of y, only one parameter is being estimated (µ). Hence, there are n 1 degrees of freedom. However, in simple regression we are estimating two parameters (β 0 and β 1 ). Therefore, we have n 2 degrees of freedom for simple regression. Connection to MSE: Note that the regression variance of y is simply SSE/DFE = MSE. Example 5: Compare the standard deviation around the regression line for the regression describing how lean body mass predicts a person s resting metabolic rate with the standard deviation for the metabolic rate. Which one is smaller and why? Also, find the regression variance of y in the regression output. Extrapolation: When doing regression analysis, it is important to keep in mind that our regression equation is based on a set range of data. (What is the range of data in the lean body mass and metabolic rate problem?) If we pick an x value that is outside the range of our data, then we should be very cautious about the prediction that we obtain for y. (For example, a negative lean body mass does not mean anything. However, our regression formula will still give us a corresponding prediction for resting metabolic rate.) This statistical problem is called extrapolating beyond the range of the data. 9