Examining Relationships Least-Squares Regression & Cautions about Correlation and Regression PSBE Chapters 2.3 and 2.4 © 2011 W. H. Freeman and Company.

Slides:



Advertisements
Similar presentations
Scatterplots and Correlation
Advertisements

CHAPTER 3 Describing Relationships
Objectives (BPS chapter 5)
Looking at data: relationships - Caution about correlation and regression - The question of causation IPS chapters 2.4 and 2.5 © 2006 W. H. Freeman and.
Chapter 3: Examining relationships between Data
Relationships Regression BPS chapter 5 © 2006 W.H. Freeman and Company.
Relationships Regression BPS chapter 5 © 2006 W.H. Freeman and Company.
Examining Relationships Scatterplots
Correlation tells us about strength (scatter) and direction of the linear relationship between two quantitative variables. In addition, we would like to.
The Practice of Statistics, 5th Edition Starnes, Tabor, Yates, Moore Bedford Freeman Worth Publishers CHAPTER 3 Describing Relationships 3.2 Least-Squares.
Chapter 5 Regression. u Objective: To quantify the linear relationship between an explanatory variable (x) and response variable (y). u We can then predict.
Correlation tells us about strength (scatter) and direction of the linear relationship between two quantitative variables. In addition, we would like to.
Business Statistics for Managerial Decision Making
Lecture 7 Simple Linear Regression. Least squares regression. Review of the basics: Sections The regression line Making predictions Coefficient.
Lecture 9 Sections 3.3 Objectives:
4. Relationships: Regression
4. Relationships: Regression
Describing Relationships
CHAPTER 3 Describing Relationships
Statistics 101 Chapter 3 Section 3.
CHAPTER 3 Describing Relationships
Chapter 3: Describing Relationships
LSRL Least Squares Regression Line
Cautions about Correlation and Regression
Regression and Residual Plots
residual = observed y – predicted y residual = y - ŷ
Chapter 3: Describing Relationships
CHAPTER 3 Describing Relationships
^ y = a + bx Stats Chapter 5 - Least Squares Regression
CHAPTER 3 Describing Relationships
Chapter 3: Describing Relationships
Unit 4 Vocabulary.
Least-Squares Regression
Chapter 3 Describing Relationships Section 3.2
Chapter 3: Describing Relationships
Review of Chapter 3 Examining Relationships
Objectives (IPS Chapter 2.3)
Looking at data: relationships - Caution about correlation and regression - The question of causation IPS chapters 2.4 and 2.5 © 2006 W. H. Freeman and.
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
Least-Squares Regression
Chapter 3: Describing Relationships
Least-Squares Regression
CHAPTER 3 Describing Relationships
CHAPTER 3 Describing Relationships
CHAPTER 3 Describing Relationships
Warmup A study was done comparing the number of registered automatic weapons (in thousands) along with the murder rate (in murders per 100,000) for 8.
CHAPTER 3 Describing Relationships
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
CHAPTER 3 Describing Relationships
Chapter 3: Describing Relationships
CHAPTER 3 Describing Relationships
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
Correlation/regression using averages
Chapter 3: Describing Relationships
CHAPTER 3 Describing Relationships
Warm-up: Pg 197 #79-80 Get ready for homework questions
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
Basic Practice of Statistics - 3rd Edition Lecture Powerpoint
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
Chapter 3: Describing Relationships
Honors Statistics Review Chapters 7 & 8
Review of Chapter 3 Examining Relationships
Correlation/regression using averages
Chapter 3: Describing Relationships
CHAPTER 3 Describing Relationships
Presentation transcript:

Examining Relationships Least-Squares Regression & Cautions about Correlation and Regression PSBE Chapters 2.3 and 2.4 © 2011 W. H. Freeman and Company

Objectives (PSBE Chapters 2.3 and 2.4) Least-Squares Regression The regression line Facts about least-squares regression Residuals Influential observations Cautions about Correlation and Regression Correlation/regression using averages Lurking variables Association is not causation

But which line best describes our data? Linear regression Correlation tells us about strength (scatter) and direction of the linear relationship between two quantitative variables. In addition, we would like to have a numerical description of how both variables vary together. For instance, is one variable increasing faster than the other one? And we would like to make predictions based on that numerical description. But which line best describes our data?

The regression line A regression line is a straight line that describes how a response variable y changes as an explanatory variable x changes. We often use a regression line to predict the value of y for a given value of x. In regression, the distinction between explanatory and response variables is important.

The regression line The least-squares regression line is the unique line such that the sum of the squared vertical (y) distances between the data points and the line is the smallest possible. Distances between the points and line are squared so all are positive values.

Equation of the regression line The least-squares regression line is the line: “y-hat” is the predicted response for any x b1 is the slope b0 is the intercept

How to: First we calculate the slope of the line, b1; from statistics we already know: r is the correlation. sy is the standard deviation of the response variable y. sx is the the standard deviation of the explanatory variable x. Once we know b1, the slope, we can calculate b0, the y-intercept: where x and y are the means of the x and y variables But typically, we use a 2-var stats calculator or stats software.

Facts about least-squares regression If we reverse the roles of the explanatory and response variables, we will get a different regression line The slope, b1 is related to the correlation coefficient, r. The least-squares line passes through the means of the x and y variables. The fraction of the variation in the values of y that is explained by the regression of y on x is r2.

BEWARE!!! Not all calculators and software use the same convention. Some use: And some use: Make sure you know what YOUR calculator gives you for a and b before you answer homework or exam questions.

Software output intercept slope R2 r R2 intercept slope

Example Regression Analysis: Selling Price ($) vs. Square Footage of Houses The regression equation is Selling Price = 4795 + 92.8 Square Footage ($) Predictor Coef SE Coef T P Constant 4795 13452 0.36 0.723 Square F 92.802 8.844 10.49 0.000 S = 30344 R-Sq = 69.6% R-Sq(adj) = 69.0% Slope: What is the change in selling price for a unit increase in square footage? Intercept: Is the intercept meaningful? Prediction: If the square footage of a house is 2500, what do we predict as the selling price?

Coefficient of determination, r2 r2, the coefficient of determination, is the square of the correlation coefficient. r2 represents the percentage of the variance in y (vertical scatter from the regression line) that can be explained by changes in x.

Coefficient of determination, r2 Changes in x explain 100% of the variations in y. Y can be entirely predicted for any given value of x. r = -1 r2 = 1

Coefficient of determination, r2 Changes in x explain 0% of the variations in y. The value(s) y takes is (are) entirely independent of what value x takes. r = 0 r2 = 0

Coefficient of determination, r2 Here the change in x only explains 78% of the change in y. The rest of the change in y (the vertical scatter, shown as red arrows) must be explained by something other than x. r = 0.885 r2 = 0.783

Extrapolation Using the regression line results in a poor prediction of the number of stores in 2008. Extrapolation is the use of a regression line for predictions outside the range of x values used to obtain the line.

The y-intercept Sometimes the y-intercept is not biologically possible. Here we have negative blood alcohol content, which makes no sense… y-intercept shows negative blood alcohol But the negative value is appropriate for the equation of the regression line.

Grade performance If GDP per capita explains 58% of the variation in net assets per capita, what is the correlation between GDP per capita and net assets per capita? 1. GDP per capita and net assets per capita are positively correlated. So r will be positive too. 2. r2 = 0.58, so r = +√0.58 = + 0.76

Residuals The distances from each point to the least-squares regression line give us potentially useful information about the contribution of individual data points to the overall pattern of scatter. These distances are called “residuals.” The sum of these residuals is always 0. Points above the line have a positive residual. Points below the line have a negative residual. Predicted ŷ Observed y

Residual plots Residuals are the distances between y-observed and y-predicted. We plot them in a residual plot. If residuals are scattered randomly around 0, chances are your data fit a linear model, were normally distributed, and you didn’t have outliers.

Residual plots The x-axis in a residual plot is the same as on the scatterplot. Only the y-axis is different.

Residuals are randomly scattered—good! Curved pattern—means the relationship you are looking at is not linear. A change in variability across plot is a warning sign. You need to find out why it is, and remember that predictions made in areas of larger variability will not be as good.

Srizbi is an influential point. Outliers and influential points Outlier: observation that lies outside the overall pattern of observations. “Influential individual”: observation that markedly changes the regression if removed. This is often an outlier on the x-axis. Srizbi is an influential point. All data Without Srizbi

Always plot your data A correlation coefficient and a regression line can be calculated for any relationship between two quantitative variables. However, outliers can greatly influence the results. Also, running a linear regression on a nonlinear association is not only meaningless but misleading. So, make sure to always plot your data before you run a correlation or regression analysis.

Always plot your data! The correlations all give r ≈ 0.816, and the regression lines are all approximately ŷ = 3 + 0.5x. For all four sets, we would predict ŷ = 8 when x = 10.

However, making the scatterplots shows us that the correlation/ regression analysis is not appropriate for all data sets. Moderate linear association; regression OK. Obvious nonlinear relationship; regression not OK. One point deviates from the highly linear pattern; this outlier must be examined closely before proceeding. Just one very influential point; all other points have the same x value; a redesign is due here.

Correlation/regression using averages Many regression or correlation studies use average data. While this is appropriate, you should know that correlations based on averages are usually much higher than when made on the raw data. The correlation is a measure of spread (scatter) in a linear relationship. Using averages greatly reduces the scatter. Therefore r and r2 are typically greatly increased when averages are used.

These histograms illustrate that each mean represents a distribution of boys of a particular age. Each dot represents an average. The variation among boys per age class is not shown. Should parents be worried if their son does not match the point for his age? If the raw values were used in the correlation instead of the mean there would be a lot of spread in the y-direction, and thus the correlation would be smaller.

That's why typically growth charts show a range of values (here from 5th to 95th percentiles). This is a more comprehensive way of displaying the same information.

Lurking variables What is the lurking variable in this example? A lurking variable is a variable not included in the study design that does have an effect on the variables studied. Lurking variables can falsely suggest a relationship. What is the lurking variable in this example? How could you answer if you didn’t know anything about the topic? Strong positive association between number of firefighters at a fire site and the amount of damage a fire does.

Vocabulary: lurking vs. confounding A lurking variable is a variable that is not among the explanatory or response variables in a study and yet may influence the interpretation of relationships among those variables. Two variables are confounded when their effects on a response variable cannot be distinguished from each other. The confounded variables may be either explanatory variables or lurking variables. But you often see them used interchangeably…

Association is not causation An association between an explanatory variable x and a response variable y, even if it is very strong, is not by itself good evidence that changes in x actually cause changes in y. Example: There is a high positive correlation between the number of television sets per person (x) and the average life expectancy (y) for the world’s nations. Could we lengthen the lives of people in Rwanda by shipping them TV sets? The best way to get evidence that x causes y is to do an experiment in which we change x and keep lurking variables under control.

Caution before rushing into a correlation or a regression analysis Do not use a regression on inappropriate data. Pattern in the residuals Presence of large outliers Use residual plots for help. Clumped data falsely appearing linear Beware of lurking variables. Avoid extrapolating (going beyond interpolation). Recognize when the correlation/regression is performed on averages. A relationship, however strong, does not itself imply causation.