appstats8.notebook October 11, 2016

Similar documents
Chapter 8. Linear Regression. The Linear Model. Fat Versus Protein: An Example. The Linear Model (cont.) Residuals

Chapter 8. Linear Regression. Copyright 2010 Pearson Education, Inc.

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

1. Create a scatterplot of this data. 2. Find the correlation coefficient.

STA Module 5 Regression and Correlation. Learning Objectives. Learning Objectives (Cont.) Upon completing this module, you should be able to:

Chapter 7 Linear Regression

Chapter 8. Linear Regression /71

Announcement. Student Opinion of Courses and Teaching (SOCT) forms will be available for you during the dates indicated:

AP Statistics. Chapter 6 Scatterplots, Association, and Correlation

appstats27.notebook April 06, 2017

Chapter 6. September 17, Please pick up a calculator and take out paper and something to write with. Association and Correlation.

Chapter 7 Summary Scatterplots, Association, and Correlation

Chapter 27 Summary Inferences for Regression

Chapter 7. Scatterplots, Association, and Correlation. Copyright 2010 Pearson Education, Inc.

Chapter 3: Examining Relationships

AP STATISTICS Name: Period: Review Unit IV Scatterplots & Regressions

AP Statistics. Chapter 9 Re-Expressing data: Get it Straight

Chapter 7. Scatterplots, Association, and Correlation

Warm-up Using the given data Create a scatterplot Find the regression line

The Whopper has been Burger King s signature sandwich since 1957.

Describing Bivariate Relationships

Scatterplots. 3.1: Scatterplots & Correlation. Scatterplots. Explanatory & Response Variables. Section 3.1 Scatterplots and Correlation

5.1 Bivariate Relationships

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

Chapter 5 Friday, May 21st

Inferences for Regression

Stat 101 Exam 1 Important Formulas and Concepts 1

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

STA Why Sampling? Module 6 The Sampling Distributions. Module Objectives

AP Final Review II Exploring Data (20% 30%)

Unit 6 - Introduction to linear regression

CHAPTER 3 Describing Relationships

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

Chapter 18. Sampling Distribution Models. Copyright 2010, 2007, 2004 Pearson Education, Inc.

THE PEARSON CORRELATION COEFFICIENT

Lecture 4 Scatterplots, Association, and Correlation

Lecture 4 Scatterplots, Association, and Correlation

Announcements. Lecture 18: Simple Linear Regression. Poverty vs. HS graduate rate

Conditions for Regression Inference:

Correlation & Simple Regression

Relationships Regression

Correlation and regression

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

Chapter 2: Looking at Data Relationships (Part 3)

Bivariate Data Summary

Important note: Transcripts are not substitutes for textbook assignments. 1

1. Use Scenario 3-1. In this study, the response variable is

4.1 Introduction. 4.2 The Scatter Diagram. Chapter 4 Linear Correlation and Regression Analysis

3.2: Least Squares Regressions

Week 11 Sample Means, CLT, Correlation

y = a + bx 12.1: Inference for Linear Regression Review: General Form of Linear Regression Equation Review: Interpreting Computer Regression Output

Review of Multiple Regression

3.1 Scatterplots and Correlation

AP Statistics. The only statistics you can trust are those you falsified yourself. RE- E X P R E S S I N G D A T A ( P A R T 2 ) C H A P 9

Chapter 6: Exploring Data: Relationships Lesson Plan

Objectives. 2.3 Least-squares regression. Regression lines. Prediction and Extrapolation. Correlation and r 2. Transforming relationships

Chapter 12 Summarizing Bivariate Data Linear Regression and Correlation

Determine is the equation of the LSRL. Determine is the equation of the LSRL of Customers in line and seconds to check out.. Chapter 3, Section 2

BIVARIATE DATA data for two variables

Chapter 3: Describing Relationships

Unit 6 - Simple linear regression

Chapter 3: Examining Relationships

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

Least-Squares Regression. Unit 3 Exploring Data

Information Sources. Class webpage (also linked to my.ucdavis page for the class):

Review. Midterm Exam. Midterm Review. May 6th, 2015 AMS-UCSC. Spring Session 1 (Midterm Review) AMS-5 May 6th, / 24

EXPERIMENT: REACTION TIME

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

Performance of fourth-grade students on an agility test

MATH 1150 Chapter 2 Notation and Terminology

Sampling Distribution Models. Chapter 17

Prof. Bodrero s Guide to Derivatives of Trig Functions (Sec. 3.5) Name:

Scatterplots and Correlation

Ch Inference for Linear Regression

The response variable depends on the explanatory variable.

Nov 13 AP STAT. 1. Check/rev HW 2. Review/recap of notes 3. HW: pg #5,7,8,9,11 and read/notes pg smartboad notes ch 3.

Stat 101 L: Laboratory 5

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

LECTURE 15: SIMPLE LINEAR REGRESSION I

Chapter 9. Correlation and Regression

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

Solving with Absolute Value

PHY 123 Lab 1 - Error and Uncertainty and the Simple Pendulum

STAB22 Statistics I. Lecture 7

AP Statistics Bivariate Data Analysis Test Review. Multiple-Choice

AP Statistics Two-Variable Data Analysis

Chapter 11. Correlation and Regression

Linear Regression Communication, skills, and understanding Calculator Use

Relationships between variables. Association Examples: Smoking is associated with heart disease. Weight is associated with height.

UNIT 12 ~ More About Regression

Linear Regression and Correlation. February 11, 2009

Probability Distributions

MAC Module 2 Modeling Linear Functions. Rev.S08

B. Weaver (24-Mar-2005) Multiple Regression Chapter 5: Multiple Regression Y ) (5.1) Deviation score = (Y i

Looking at data: relationships

6.1.1 How can I make predictions?

Chapter 3: Describing Relationships

Algebra 1 Practice Test Modeling with Linear Functions Unit 6. Name Period Date

1) A residual plot: A)

Sampling, Frequency Distributions, and Graphs (12.1)

Transcription:

Chapter 8 Linear Regression Objective: Students will construct and analyze a linear model for a given set of data.

Fat Versus Protein: An Example pg 168 The following is a scatterplot of total fat versus protein for 30 items on the Burger King menu: Correlation says There seems to be a linear association between these two variables, but it doesn t tell what that association is. The Linear Model pg 169 We can say more about the linear relationship between two quantitative variables with a model. A model simplifies reality to help us understand underlying patterns and relationships.

Linear Regression Now that we know how to observe thedirection and strength of a linear relationship, we can model the relationship. Just as we used a Normal Model to approximate distributions of data that were unimodal and symmetric, We can use a linear model to make approximate predictions about a data set showing a linear relationship. The Linear Model (cont.) pg 169 The linear model is just an equation of a straight line through the data. The points in the scatterplot don t all line up, but a straight line can summarize the general pattern. The linear model can help us understand how the values are associated.

Correlation and the Line pg 170 Moving one standard deviation away from the mean in x moves us r standard deviations away from the mean in y. This relationship is shown in a scatterplot of z scores for fat and protein:

Correlation and the Line (cont.) pg 170 Put generally, moving any number of standard deviations away from the mean in x moves us r times that number of standard deviations away from the mean in y. How Big Can Predicted Values Get? pg 172 r cannot be bigger than 1 (in absolute value), so each predicted y tends to be closer to its mean (in standard deviations) than its corresponding x was. This property of the linear model is called regression to the mean; the line is called the regression line.

The Least Squares Line pg 174 We write our model as This model says that our predictions from our model follow a straight line. If the model is a good one, the data values will scatter closely around it. The Least Squares Line (cont.) pg 174 In our model, we also have an intercept (b 0 ). The intercept is built from the means and the slope: Our intercept is always in units of y.

The Least Squares Line (cont.) pg 174 In our model, we have a slope (b 1 ): The slope is built from the correlation and the standard deviations: Our slope is always in units of y per unit of x. The Least Squares Line (cont.) Since regression and correlation are closely related, we need to check the same conditions for regressions as we did for correlations: Quantitative Variables Condition Straight Enough Condition Outlier Condition pg 176 see step by step

Fat Versus Protein: An Example pg 175 The regression line for the Burger King data fits the data well: The equation is The predicted fat content for a BK Broiler chicken sandwich is 6.8 + 0.97(30) = 35.9 grams of fat. Assumptions and Conditions Quantitative Variables Condition: pg 176 Regression can only be done on two quantitative variables, so make sure to check this condition. Straight Enough Condition: The linear model assumes that the relationship between the variables is linear. A scatterplot will let you check that the assumption is reasonable.

Assumptions and Conditions (cont.) Outlier Condition: Watch out for outliers. Outlying points can dramatically change a regression model. Outliers can even change the sign of the slope, misleading us about the underlying relationship between the variables. Assumptions and Conditions (cont.) pg 176 1.It s a good idea to check linearity again after computing the regression when we can examine the residuals. 2.You should also check for outliers, which could change the regression. 3.If the data seem to clump or cluster in the scatterplot, that could be a sign of trouble worth looking into further.

Assumptions and Conditions (cont.) pg 176 see step by step go over If the scatterplot is not straight enough, stop here. You can t use a linear model for any two variables, even if they are related. They must have a linear association or the model won t mean a thing. Some nonlinear relationships can be saved by re expressing the data to make the scatterplot more linear. Example 1

Example 1 Objectives: Students will be able to interpret the slope and y intercept of a linear model in context of the data. Students will be able to informally assess the fit of a function by plotting and analyzing residuals.

Residuals pg 169 The model won t be perfect, regardless of the line we draw. Some points will be above the line and some will be below. The estimate made from a model is the predicted value (denoted as ). Residuals Revisited pg 178 The linear model assumes that the relationship between the two variables is a perfect straight line. The residuals are the part of the data that hasn t been modeled. Data = Model + Residual or (equivalently) Residual = Data Model Or, in symbols,

Residuals (cont.) pg 169 The difference between the observed value and its associated predicted value is called the residual. To find the residuals, we always subtract the predicted value from the observed one: Let's go back to the example unit test 1 and semester test Residual Plots predicted A residual is the difference between the observed y value and the y value for a given x value. residual = y yˆ Sum of the least Square Residuals The (SSR) is used to determine the Least Squares Regression Line for a given set of data.

Best Fit Means Least Squares pg 170 Some residuals are positive, others are negative, and, on average, they cancel each other out. So, we can t assess how well the line fits by adding up all the residuals. Similar to what we did with deviations, we square the residuals and add the squares. The smaller the sum, the better the fit. The line of best fit is the line for which the sum of the squared residuals is smallest. Residuals (cont.) pg 169 A negative residual means the predicted value s too big (an overestimate). A positive residual means the predicted value s too small (an underestimate).

Residuals Revisited (cont.) pg 178 Residuals help us to see whether the model makes sense. When a regression model is appropriate, nothing interesting should be left behind. After we fit a regression model, we usually plot the residuals in the hope of finding nothing. Residuals Revisited (cont.) pg 178 The residuals for the BK menu regression look appropriately boring:

closure A is a scatterplot which graphs the residuals on the axis and the values of the explanatory variable on the axis for each data point,( ) The residual plot gives a visual representation of the amount of error in the model. The closer the residuals are to, the smaller the error and the more accurate the model. The LSRL is a good model if the residual plot shows random relatively close to the horizontal axis (zero). The horizontal axis represents the. Points in the residual plot that lie directly on the horizontal axis lie directly on the. Points in the residual plot that lie above the horizontal axis lie the LSRL. Therefore, the model gives an underestimate at that point. Therefore residuals represent underestimates. Points in the residual plot that lie below the horizontal axis, lie the LSRL. Therefore the model gives an overestimate at that point. Therefore residuals represent overestimates. The LSRL is not a good model if the residual plot shows.

Objectives: Students will be able calculate the coefficient of determination and interpret its value for evaluating the regression line. R 2 The Variation Accounted For pg 179 The variation in the residuals is the key to assessing how well the model fits. In the BK menu items example, total fat has a standard deviation of 16.4 grams. The standard deviation of the residuals is 9.2 grams.

R 2 The Variation Accounted For (cont.) pg 179 If the correlation were 1.0 and the model predicted the fat values perfectly, the residuals would all be zero and have no variation. As it is, the correlation is 0.83 not perfection. However, we did see that the model residuals had less variation than total fat alone. We can determine how much of the variation is accounted for by the model and how much is left in the residuals. Review The residuals also reveal how well the model works. If a plot of the residuals against predicted values shows a pattern, we should re examine the data to see why. The standard deviation of the residuals quantifies the amount of scatter around the line.

R 2 The Variation Accounted For (cont.) pg 179 The squared correlation, r 2, gives the fraction of the data s variance accounted for by the model. Thus, 1 r 2 is the fraction of the original variance left in the residuals. For the BK model, r 2 = 0.83 2 = 0.69, so 31% of the variability in total fat has been left in the residuals. R 2 The Variation Accounted For (cont.) pg 179 All regression analyses include this statistic, although by tradition, it is written R 2 (pronounced R squared ). An R 2 of 0 means that none of the variance in the data is in the model; all of it is still in the residuals. When interpreting a regression model you need to Tell what R 2 means. In the BK example, 69% of the variation in total fat is accounted for by the model.

How Big Should R 2 Be? pg 180 R 2 is always between 0% and 100%. What makes a good R 2 value depends on the kind of data you are analyzing and on what you want to do with it. The standard deviation of the residuals can give us more information about the usefulness of the regression by telling us how much scatter there is around the line. Reporting R 2 pg 181 183 see TI Tips see step by step Along with the slope and intercept for a regression, you should always report R 2 so that readers can judge for themselves how successful the regression is at fitting the data. Statistics is about variation, and R 2 measures the success of the regression model in terms of the fraction of the variation of y accounted for by the regression.

Coefficient of Determination The coefficient of determination, also called R 2, is the square of the. The R 2 valuetells how much of the variation in the response variable is accounted for by the linear regression model. 100 correlation For example, if R 2 = 1, then % of the variability in the response variable is accounted for by thelinear model. In other words, the relationship between the two variables is perfectly linear. 95 If R 2 = 0.95,we can conclude that % of the variability in the response variable is accounted for by the linear relationship with the explanatory variable. Example 2. A study of class attendance and grades earned among first year students at a state university showed that in general students who attended a higher percent of their classes earned higher grades. Class attendance explained 16% of the variation in grades among the students. What is the numerical correlation between percent of classes attended and grades earned? Closure

Reality Check: Is the Regression Reasonable? pg 184 Statistics don t come out of nowhere. They are based on data. The results of a statistical analysis should reinforce your common sense, not fly in its face. If the results are surprising, then either you ve learned something new about the world or your analysis is wrong. When you perform a regression, think about the coefficients and ask yourself whether they make sense.

What Can Go Wrong? pg 185 Don t fit a straight line to a nonlinear relationship. Beware extraordinary points (y values that stand off from the linear pattern or extreme x values). Don t extrapolate beyond the data the linear model may no longer hold outside of the range of the data. Don t infer that x causes y just because there is a good linear model for their relationship association is not causation. Don t choose a model based on R 2 alone. What have we learned? pg 186 When the relationship between two quantitative variables is fairly straight, a linear model can help summarize that relationship. The regression line doesn t pass through all the points, but it is the best compromise in the sense that it has the smallest sum of squared residuals.

What have we learned? (cont.) pg 186 The correlation tells us several things about the regression: 1)The slope of the line is based on the correlation, adjusted for the units of x and y. 2)For each SD in x that we are away from the x mean, we expect to be r SDs in y away from the y mean. 3)Since r is always between 1 and +1, each predicted y is fewer SDs away from its mean than the corresponding x was (regression to the mean). 4)R 2 gives us the fraction of the response accounted for by the regression model. What have we learned? pg 186 The residuals also reveal how well the model works. If a plot of the residuals against predicted values shows a pattern, we should re examine the data to see why. The standard deviation of the residuals quantifies the amount of scatter around the line.

1. Below are heights and weights data for male and female AP Stat students. Create TI lists MHT, MWT, FHT, FWT, and enter the data. You will need to keep these data for several days. Remember, to create a list: 1 put the cursor atop the names L1,L2,..., then 2 space to the right, and 3 type the new name in the blank space. You can then access these names via the LIST NAMES menu. 2. Is it reasonable to assume these data are drawn from populations that are normally distributed? Check summary statistics and histograms for each variable. 3. a Make a scatterplot for each gender STAT PLOT, first plot type. Which is the explanatory variable? b Describe the relationship form, strength, direction, outliers, etc. for each gender. 4. a Calculate and interpret r for each gender. b What would you predict about the weight of... someone of average height?... a male 2 standard deviations above average in height.... a female 1 standard deviation below average in height? c Explain how this illustrates the concept of regression toward the mean. d Calculate the coefficients of determination, r2, and interpret each in the context of this relationship. 5. a Write an equation of the least squares line of best fit for each gender. b Check the residuals plots. Do you think that a line is a good model? Explain. c Explain what the slope of each line means in the context of this relationship. d Predict weights for : a 60 male; a 60 female; a 70 male; a 70 female e Predict the weight of a 7 2 male; of a 20 newborn baby girl. Comment on these results.