Comparison of the Chi-Square Tests You have seen the χ 2 test statistic used in three different circumstances. The following bulleted list is a summary that will help you decide which χ 2 test is the appropriate one to use. Goodness-of-Fit: Use the goodness-of-fit test to decide whether a population with an unknown distribution "fits" a known distribution. In this case there will be a single qualitative survey question or a single outcome of an experiment from a single population. Goodness-of-Fit is typically used to see if the population is uniform (all outcomes occur with equal frequency), the population is normal, or the population is the same as another population with a known distribution. The null and alternative hypotheses are: H 0 : The population fits the given distribution. H a : The population does not fit the given distribution. Independence: Use the test for independence to decide whether two variables (factors) are independent or dependent. In this case there will be two qualitative survey questions or experiments and a contingency table will be constructed. The goal is to see if the two variables are unrelated (independent) or related (dependent). The null and alternative hypotheses are: H 0 : The two variables (factors) are independent. H a : The two variables (factors) are dependent. Homogeneity: Use the test for homogeneity to decide if two populations with unknown distributions have the same distribution as each other. In this case there will be a single qualitative survey question or experiment given to two different populations. The null and alternative hypotheses are: H 0 : The two populations follow the same distribution. H a : The two populations have different distributions. Chapter Review The goodness-of-fit test is typically used to determine if data fits a particular distribution. The test of independence makes use of a contingency table to determine the independence of two factors. The test for homogeneity determines whether two populations come from the same distribution, even if this distribution is unknown. Which test do you use to decide whether an observed distribution is the same as an expected distribution? a goodness-of-fit test What is the null hypothesis for the type of test from ? Which test would you use to decide whether two factors have a relationship? a test for independence Which test would you use to decide if two populations have the same distribution? How are tests of independence similar to tests for homogeneity? Answers will vary. Sample answer: Tests of independence and tests for homogeneity both calculate the test statistic the same way ∑ ( i j ) ( O - E ) 2 E . In addition, all values must be greater than or equal to five. How are tests of independence different from tests for homogeneity? Homework For each word problem, use a solution sheet to solve the hypothesis test problem. Go to for the chi-square solution sheet. Round expected frequency to two decimal places. Is there a difference between the distribution of community college statistics students and the distribution of university statistics students in what technology they use on their homework? Of some randomly selected community college students, 43 used a computer, 102 used a calculator with built in statistics functions, and 65 used a table from the textbook. Of some randomly selected university students, 28 used a computer, 33 used a calculator with built in statistics functions, and 40 used a table from the textbook. Conduct an appropriate hypothesis test using a 0.05 level of significance. H 0 : The distribution for technology use is the same for community college students and university students. H a : The distribution for technology use is not the same for community college students and university students. 2 chi-square with df = 2 7.05 p -value = 0.0294 Answers may vary. Alpha: 0.05 Decision: Reject the null hypothesis. Reason for decision: p -value < alpha Conclusion: There is sufficient evidence to conclude that the distribution of technology use for statistics homework is not the same for statistics students at community colleges and at universities. Read the statement and decide whether it is true or false. If df = 2, the chi-square distribution has a shape that reminds us of the exponential. Bringing It Together Explain why a goodness-of-fit test and a test of independence are generally right-tailed tests. If you did a left-tailed test, what would you be testing? The test statistic is always positive and if the expected and observed values are not close together, the test statistic is large and the null hypothesis will be rejected. Testing to see if the data fits the distribution “too well” or is too perfect.

Math


Test of a Single Variance A test of a single variance assumes that the underlying distribution is normal . The null and alternative hypotheses are stated in terms of the population variance (or population standard deviation). The test statistic is: ( n - 1 ) s 2 σ 2 where: n = the total number of data s 2 = sample variance σ 2 = population variance You may think of s as the random variable in this test. The number of degrees of freedom is df = n - 1. A test of a single variance may be right-tailed, left-tailed, or two-tailed. will show you how to set up the null and alternative hypotheses. The null and alternative hypotheses contain statements about the population variance. Math instructors are not only interested in how their students do on exams, on average, but how the exam scores vary. To many instructors, the variance (or standard deviation) may be more important than the average. Suppose a math instructor believes that the standard deviation for his final exam is five points. One of his best students thinks otherwise. The student claims that the standard deviation is more than five points. If the student were to conduct a hypothesis test, what would the null and alternative hypotheses be? Even though we are given the population standard deviation, we can set up the test using the population variance as follows. H 0 : σ 2 = 5 2 H a : σ 2 > 5 2 Try It A SCUBA instructor wants to record the collective depths each of his students dives during their checkout. He is interested in how the depths vary, even though everyone should have been at the same depth. He believes the standard deviation is three feet. His assistant thinks the standard deviation is less than three feet. If the instructor were to conduct a test, what would the null and alternative hypotheses be? With individual lines at its various windows, a post office finds that the standard deviation for normally distributed waiting times for customers on Friday afternoon is 7.2 minutes. The post office experiments with a single, main waiting line and finds that for a random sample of 25 customers, the waiting times for customers have a standard deviation of 3.5 minutes. With a significance level of 5%, test the claim that a single line causes lower variation among waiting times (shorter waiting times) for customers . Since the claim is that a single line causes less variation, this is a test of a single variance. The parameter is the population variance, σ 2 , or the population standard deviation, σ . Random Variable: The sample standard deviation, s , is the random variable. Let s = standard deviation for the waiting times. H 0 : σ 2 = 7.2 2 H a : σ 2 < 7.2 2 The word "less" tells you this is a left-tailed test. Distribution for the test: χ 24 2 , where: n = the number of customers sampled df = n – 1 = 25 – 1 = 24 Calculate the test statistic: χ 2 = ( n − 1 ) s 2 σ 2 = ( 25 − 1 ) ( 3.5 ) 2 7.2 2 = 5.67 where n = 25, s = 3.5, and σ = 7.2. Graph: Probability statement: p -value = P ( χ 2 < 5.67) = 0.000042 Compare α and the p -value: α = 0.05 p -value = 0.000042 α > p -value Make a decision: Since α > p -value, reject H 0 . This means that you reject σ 2 = 7.2 2 . In other words, you do not think the variation in waiting times is 7.2 minutes; you think the variation in waiting times is less. Conclusion: At a 5% level of significance, from the data, there is sufficient evidence to conclude that a single line causes a lower variation among the waiting times or with a single line, the customer waiting times vary less than 7.2 minutes. In 2nd DISTR , use 7:χ2cdf . The syntax is (lower, upper, df) for the parameter list. For , χ2cdf(-1E99,5.67,24) . The p -value = 0.000042. Try It The FCC conducts broadband speed tests to measure how much data per second passes between a consumer’s computer and the internet. At a certain point in time, the standard deviation of Internet speeds across Internet Service Providers (ISPs) was 12.2 percent. Suppose a sample of 15 ISPs is taken, and the standard deviation is 13.2. An analyst claims that the standard deviation of speeds is more than what was reported. State the null and alternative hypotheses, compute the degrees of freedom, the test statistic, sketch the graph of the p -value, and draw a conclusion. Test at the 1% significance level. References “AppleInsider Price Guides.” Apple Insider, 2013. Available online at http://appleinsider.com/mac_price_guide (accessed May 14, 2013). Data from the World Bank, June 5, 2012. Chapter Review To test variability, use the chi-square test of a single variance. The test may be left-, right-, or two-tailed, and its hypotheses are always expressed in terms of the variance (or standard deviation). Formula Review χ 2 = ( n − 1 ) ⋅ s 2 σ 2 Test of a single variance statistic where: n : sample size s : sample standard deviation σ : population standard deviation df = n – 1 Degrees of freedom Test of a Single Variance Use the test to determine variation. The degrees of freedom is the number of samples – 1. The test statistic is ( n – 1 ) ⋅ s 2 σ 2 , where n = the total number of data, s 2 = sample variance, and σ 2 = population variance. The test may be left-, right-, or two-tailed. Use the following information to answer the next three exercises: An archer’s standard deviation for hits is six (data is measured in distance from the center of the target). An observer claims the standard deviation is less. What type of test should be used? a test of a single variance State the null and alternative hypotheses. Is this a right-tailed, left-tailed, or two-tailed test? a left-tailed test Use the following information to answer the next three exercises: The standard deviation of heights for students in a school is 0.81. A random sample of 50 students is taken, and the standard deviation of heights of the sample is 0.96. A researcher in charge of the study believes the standard deviation of heights for the school is greater than 0.81. What type of test should be used? State the null and alternative hypotheses. H 0 : σ 2 = 0.81 2 ; H a : σ 2 > 0.81 2 df = ________ Use the following information to answer the next four exercises: The average waiting time in a doctor’s office varies. The standard deviation of waiting times in a doctor’s office is 3.4 minutes. A random sample of 30 patients in the doctor’s office has a standard deviation of waiting times of 4.1 minutes. One doctor believes the variance of waiting times is greater than originally thought. What type of test should be used? a test of a single variance What is the test statistic? What is the p -value? 0.0542 What can you conclude at the 5% significance level? Homework Use the following information to answer the next twelve exercises: Suppose an airline claims that its flights are consistently on time with an average delay of at most 15 minutes. It claims that the average delay is so consistent that the variance is no more than 150 minutes. Doubting the consistency part of the claim, a disgruntled traveler calculates the delays for his next 25 flights. The average delay for those 25 flights is 22 minutes with a standard deviation of 15 minutes. Is the traveler disputing the claim about the average or about the variance? A sample standard deviation of 15 minutes is the same as a sample variance of __________ minutes. 225 Is this a right-tailed, left-tailed, or two-tailed test? H 0 : __________ H 0 : σ 2 ≤ 150 df = ________ chi-square test statistic = ________ 36 p -value = ________ Graph the situation. Label and scale the horizontal axis. Mark the mean and test statistic. Shade the p -value. Answers may vary. Let α = 0.05 Decision: ________ Conclusion (write out in a complete sentence.): ________ How did you know to test the variance instead of the mean? The claim is that the variance is no more than 150 minutes. If an additional test were done on the claim of the average delay, which distribution would you use? If an additional test were done on the claim of the average delay, but 45 flights were surveyed, which distribution would you use? a Student's t - or normal distribution For each word problem, use a solution sheet to solve the hypothesis test problem. Go to for the chi-square solution sheet. Round expected frequency to two decimal places. A plant manager is concerned their equipment may need recalibrating. It seems that the actual weight of the 15 oz. cereal boxes it fills has been fluctuating. The standard deviation should be at most 0.5 oz. In order to determine if the machine needs to be recalibrated, 84 randomly selected boxes of cereal from the next day’s production were weighed. The standard deviation of the 84 boxes was 0.54. Does the machine need to be recalibrated? Consumers may be interested in whether the cost of a particular calculator varies from store to store. Based on surveying 43 stores, which yielded a sample mean of $84 and a sample standard deviation of $12, test the claim that the standard deviation is greater than $15. H 0 : σ = 15 H a : σ > 15 df = 42 chi-square with df = 42 test statistic = 26.88 p -value = 0.9663 Answers may vary. Alpha = 0.05 Decision: Do not reject null hypothesis. Reason for decision: p -value > alpha Conclusion: There is insufficient evidence to conclude that the standard deviation is greater than 15. Isabella, an accomplished Bay to Breakers runner, claims that the standard deviation for her time to run the 7.5 mile race is at most three minutes. To test her claim, Rupinder looks up five of her race times. They are 55 minutes, 61 minutes, 58 minutes, 63 minutes, and 57 minutes. Airline companies are interested in the consistency of the number of babies on each flight, so that they have adequate safety equipment. They are also interested in the variation of the number of babies. Suppose that an airline executive believes the average number of babies on flights is six with a variance of nine at most. The airline conducts a survey. The results of the 18 flights surveyed give a sample average of 6.4 with a sample standard deviation of 3.9. Conduct a hypothesis test of the airline executive’s belief. H 0 : σ ≤ 3 H a : σ > 3 df = 17 chi-square distribution with df = 17 test statistic = 28.73 p -value = 0.0371 Answers may vary. Alpha: 0.05 Decision: Reject the null hypothesis. Reason for decision: p -value < alpha Conclusion: There is sufficient evidence to conclude that the standard deviation is greater than three. The number of births per woman in China is 1.6 down from 5.91 in 1966. This fertility rate has been attributed to the law passed in 1979 restricting births to one per woman. Suppose that a group of students studied whether or not the standard deviation of births per woman was greater than 0.75. They asked 50 women across China the number of births they had had. The results are shown in . Does the students’ survey indicate that the standard deviation is greater than 0.75? # of births Frequency 0 5 1 30 2 10 3 5 According to an avid aquarist, the average number of fish in a 20-gallon tank is 10, with a standard deviation of two. His friend, also an aquarist, does not believe that the standard deviation is two. They count the number of fish in 15 other 20-gallon tanks. Based on the results that follow, do you think that the standard deviation is different from two? Data: 11; 10; 9; 10; 10; 11; 11; 10; 12; 9; 7; 9; 11; 10; 11 H 0 : σ = 2 H a : σ ≠ 2 df = 14 chi-square distiribution with df = 14 chi-square test statistic = 5.2094 p -value = 0.0346 Answers may vary. Alpha = 0.05 Decision: Reject the null hypothesis Reason for decision: p -value < alpha Conclusion: There is sufficient evidence to conclude that the standard deviation is different than 2. The manager of "Frenchies" is concerned that patrons are not consistently receiving the same amount of French fries with each order. The chef claims that the standard deviation for a ten-ounce order of fries is at most 1.5 oz., but the manager thinks that it may be higher. He randomly weighs 49 orders of fries, which yields a mean of 11 oz. and a standard deviation of two oz. You want to buy a specific computer. A sales representative of the manufacturer claims that retail stores sell this computer at an average price of $1,249 with a very narrow standard deviation of $25. You find a website that has a price comparison for the same computer at a series of stores as follows: $1,299; $1,229.99; $1,193.08; $1,279; $1,224.95; $1,229.99; $1,269.95; $1,249. Can you argue that pricing has a larger standard deviation than claimed by the manufacturer? Use the 5% significance level. As a potential buyer, what would be the practical conclusion from your analysis? The sample standard deviation is $34.29. H 0 : σ 2 = 25 2 H a : σ 2 > 25 2 df = n – 1 = 7. test statistic: x 2 = x 7 2 = ( n – 1 ) s 2 25 2 = ( 8 – 1 ) ( 34.29 ) 2 25 2 = 13.169 ; p -value: P ( x 7 2 > 13.169 ) = 1 – P ( x 7 2 ≤ 13.169 ) = 0.0681 Alpha: 0.05 Decision: Do not reject the null hypothesis. Reason for decision: p -value > alpha Conclusion: At the 5% level, there is insufficient evidence to conclude that the variance is more than 625. A company packages apples by weight. One of the weight grades is Class A apples. Class A apples have a mean weight of 150 g, and there is a maximum allowed weight tolerance of 5% above or below the mean for apples in the same consumer package. A batch of apples is selected to be included in a Class A apple package. Given the following apple weights of the batch, does the fruit comply with the Class A grade weight tolerance requirements. Conduct an appropriate hypothesis test. (a) at the 5% significance level (b) at the 1% significance level Weights in selected apple batch (in grams): 158; 167; 149; 169; 164; 139; 154; 150; 157; 171; 152; 161; 141; 166; 172;

Math


Lab 1: Chi-Square Goodness-of-Fit Lab 1: Chi-Square Goodness-of-Fit Class Time: Names: Student Learning Outcome The student will evaluate data collected to determine if they fit either the uniform or exponential distributions. Collect the Data Go to your local supermarket. Ask 30 people as they leave for the total amount on their grocery receipts. (Or, ask three cashiers for the last ten amounts. Be sure to include the express lane, if it is open.) NOTE You may need to combine two categories so that each cell has an expected value of at least five. Record the values. Construct a histogram of the data. Make five to six intervals. Sketch the graph using a ruler and pencil. Scale the axes. Calculate the following: x ¯ = ________ s = ________ s 2 = ________ Uniform Distribution Test to see if grocery receipts follow the uniform distribution. Using your lowest and highest values, X ~ U (_______, _______) Divide the distribution into fifths. Calculate the following: lowest value = _________ 20 th percentile = _________ 40 th percentile = _________ 60 th percentile = _________ 80 th percentile = _________ highest value = _________ For each fifth, count the observed number of receipts and record it. Then determine the expected number of receipts and record that. Fifth Observed Expected 1 st 2 nd 3 rd 4 th 5 th H 0 : ________ H a : ________ What distribution should you use for a hypothesis test? Why did you choose this distribution? Calculate the test statistic. Find the p -value. Sketch a graph of the situation. Label and scale the x -axis. Shade the area corresponding to the p -value. State your decision. State your conclusion in a complete sentence. Exponential Distribution Test to see if grocery receipts follow the exponential distribution with decay parameter 1 x ¯ . Using 1 x ¯ as the decay parameter, X ~ Exp (_________). Calculate the following: lowest value = ________ first quartile = ________ 37 th percentile = ________ median = ________ 63 rd percentile = ________ 3 rd quartile = ________ highest value = ________ For each cell, count the observed number of receipts and record it. Then determine the expected number of receipts and record that. Cell Observed Expected 1 st 2 nd 3 rd 4 th 5 th 6 th H 0 : ________ H a : ________ What distribution should you use for a hypothesis test? Why did you choose this distribution? Calculate the test statistic. Find the p -value. Sketch a graph of the situation. Label and scale the x -axis. Shade the area corresponding to the p -value. State your decision. State your conclusion in a complete sentence. Discussion Questions Did your data fit either distribution? If so, which? In general, do you think it’s likely that data could fit more than one distribution? In complete sentences, explain why or why not.

Math


Lab 2: Chi-Square Test of Independence Lab 2: Chi-Square Test of Independence Class Time: Names: Student Learning Outcome The student will evaluate if there is a significant relationship between favorite type of snack and gender. Collect the Data Using your class as a sample, complete the following chart. Ask each other what your favorite snack is, then total the results. Note You may need to combine two food categories so that each cell has an expected value of at least five. Favorite type of snack sweets (candy & baked goods) ice cream chips & pretzels fruits & vegetables Total men women Total Looking at , does it appear to you that there is a dependence between gender and favorite type of snack food? Why or why not? Hypothesis Test Conduct a hypothesis test to determine if the factors are independent: H 0 : ________ H a : ________ What distribution should you use for a hypothesis test? Why did you choose this distribution? Calculate the test statistic. Find the p -value. Sketch a graph of the situation. Label and scale the x -axis. Shade the area corresponding to the p -value. State your decision. State your conclusion in a complete sentence. Discussion Questions Is the conclusion of your study the same as or different from your answer to answer to question two under Collect the Data ? Why do you think that occurred?

Math


Introduction Linear regression and correlation can help you determine if an auto mechanic’s salary is related to his work experience. (credit: modification of work “USPS commissions local repair-shop for some needed work on its older trucks” by Joshua Rothhaas/ Flickr, CC BY 2.0) Chapter Objectives By the end of this chapter, the student should be able to: Discuss basic ideas of linear regression and correlation. Create and interpret a line of best fit. Calculate and interpret the correlation coefficient. Calculate and interpret outliers. Professionals often want to know how two or more numeric variables are related. For example, is there a relationship between the grade on the second math exam a student takes and the grade on the final exam? If there is a relationship, what is the relationship and how strong is it? In another example, your income may be determined by your education, your profession, your years of experience, and your ability. The amount you pay a repair person for labor is often determined by an initial amount plus an hourly fee. The type of data described in the examples is bivariate data — "bi" for two variables. In reality, statisticians use multivariate data, meaning many variables. In this chapter, you will be studying the simplest form of regression, "linear regression" with one independent variable ( x ). This involves data that fits a line in two dimensions. You will also study correlation which measures how strong the relationship is.

Math


Linear Equations Linear regression for two variables is based on a linear equation with one independent variable. The equation has the form: y = a + bx where a and b are constant numbers. The variable x is the independent variable, and y is the dependent variable. Typically, you choose a value to substitute for the independent variable and then solve for the dependent variable. The following examples are linear equations. y = 3 + 2x y = –0.01 + 1.2x Try It Is the following an example of a linear equation? y = –0.125 – 3.5 x The graph of a linear equation of the form y = a + bx is a straight line . Any line that is not vertical can be described by this equation. Graph the equation y = –1 + 2 x . Try It Is the following an example of a linear equation? Why or why not? A local small business completes federal tax returns for customers. The rate for services is $32 per hour plus a $31.50 one-time charge. The total cost to a customer depends on the number of hours it takes to complete the job. Find the equation that expresses the total cost in terms of the number of hours required to complete the job. Let x = the number of hours it takes to get the job done. Let y = the total cost to the customer. The $31.50 is a fixed cost. If it takes x hours to complete the tax return, then (32)( x ) is the cost of the tax return processing only. The total cost is: y = 31.50 + 32 x Try It Emma’s Extreme Sports hires hang-gliding instructors and pays them a fee of $50 per class as well as $20 per student in the class. The total cost Emma pays depends on the number of students in a class. Find the equation that expresses the total cost in terms of the number of students in a class. Slope and Y -Intercept of a Linear Equation For the linear equation y = a + bx , b = slope and a = y -intercept. From algebra recall that the slope is a number that describes the steepness of a line, and the y -intercept is the y coordinate of the point (0, a ) where the line crosses the y -axis. Three possible graphs of y = a + bx . (a) If b > 0, the line slopes upward to the right. (b) If b = 0, the line is horizontal. (c) If b < 0, the line slopes downward to the right. Svetlana tutors to make extra money for college. For each tutoring session, she charges a one-time fee of $25 plus $15 per hour of tutoring. A linear equation that expresses the total amount of money Svetlana earns for each session she tutors is y = 25 + 15 x . What are the independent and dependent variables? What is the y -intercept and what is the slope? Interpret them using complete sentences. The independent variable ( x ) is the number of hours Svetlana tutors each session. The dependent variable ( y ) is the amount, in dollars, Svetlana earns for each session. The y -intercept is 25 ( a = 25). At the start of the tutoring session, Svetlana charges a one-time fee of $25 (this is when x = 0). The slope is 15 ( b = 15). For each session, Svetlana earns $15 for each hour she tutors. Try It Ethan repairs household appliances like dishwashers and refrigerators. For each visit, he charges $25 plus $20 per hour of work. A linear equation that expresses the total amount of money Ethan earns per visit is y = 25 + 20 x . What are the independent and dependent variables? What is the y -intercept and what is the slope? Interpret them using complete sentences. References Data from the Centers for Disease Control and Prevention. Data from the National Center for agency reporting flu cases and TB Prevention. Chapter Review The most basic type of association is a linear association. This type of relationship can be defined algebraically by the equations used, numerically with actual or predicted data values, or graphically from a plotted curve. (Lines are classified as straight curves.) Algebraically, a linear equation typically takes the form y = mx + b , where m and b are constants, x is the independent variable, y is the dependent variable. In a statistical context, a linear equation is written in the form y = a + bx , where a and b are the constants. This form is used to help readers distinguish the statistical context from the algebraic context. In the equation y = a + bx , the constant b , called a coefficient, represents the slope . The constant a is called the y -intercept. The slope of a line is a value that describes the rate of change between the independent and dependent variables. The slope tells us how the dependent variable ( y ) changes for every one unit increase in the independent ( x ) variable, on average. The y -intercept is used to describe the dependent variable when the independent variable equals zero. Formula Review y = a + bx where a is the y -intercept and b is the slope. The variable x is the independent variable and y is the dependent variable. Use the following information to answer the next three exercises . A vacation resort rents SCUBA equipment to certified divers. The resort charges an up-front fee of $25 and another fee of $12.50 an hour. What are the dependent and independent variables? dependent variable: fee amount; independent variable: time Find the equation that expresses the total fee in terms of the number of hours the equipment is rented. Graph the equation from . Use the following information to answer the next two exercises . A credit card company charges $10 when a payment is late, and $5 a day each day the payment remains unpaid. Find the equation that expresses the total fee in terms of the number of days the payment is late. Graph the equation from . Is the equation y = 10 + 5 x – 3 x 2 linear? Why or why not? Which of the following equations are linear? a. y = 6 x + 8 b. y + 7 = 3 x c. y – x = 8 x 2 d. 4 y = 8 y = 6 x + 8, 4 y = 8, and y + 7 = 3 x are all linear equations. Does the graph show a linear equation? Why or why not? contains real data for the first two decades of flu reporting. Adults and Adolescents only, United States Year # flu cases diagnosed # flu deaths Pre-1981 91 29 1981 319 121 1982 1,170 453 1983 3,076 1,482 1984 6,240 3,466 1985 11,776 6,878 1986 19,032 11,987 1987 28,564 16,162 1988 35,447 20,868 1989 42,674 27,591 1990 48,634 31,335 1991 59,660 36,560 1992 78,530 41,055 1993 78,834 44,730 1994 71,874 49,095 1995 68,505 49,456 1996 59,347 38,510 1997 47,149 20,736 1998 38,393 19,005 1999 25,174 18,454 2000 25,522 17,347 2001 25,643 17,402 2002 26,464 16,371 Total 802,118 489,093 Use the columns "year" and "# flu cases diagnosed. Why is “year” the independent variable and “# flu cases diagnosed.” the dependent variable (instead of the reverse)? The number of flu cases depends on the year. Therefore, year becomes the independent variable and the number of flu cases is the dependent variable. Use the following information to answer the next two exercises . A specialty cleaning company charges an equipment fee and an hourly labor fee. A linear equation that expresses the total amount of the fee the company charges for each session is y = 50 + 100 x . What are the independent and dependent variables? What is the y -intercept and what is the slope? Interpret them using complete sentences. The y -intercept is 50 ( a = 50). At the start of the cleaning, the company charges a one-time fee of $50 (this is when x = 0). The slope is 100 ( b = 100). For each session, the company charges $100 for each hour they clean. Use the following information to answer the next three questions . Due to erosion, a river shoreline is losing several thousand pounds of soil each year. A linear equation that expresses the total amount of soil lost per year is y = 12,000 x . What are the independent and dependent variables? How many pounds of soil does the shoreline lose in a year? 12,000 pounds of soil What is the y -intercept? Interpret its meaning. Use the following information to answer the next two exercises . The price of a single issue of stock can fluctuate throughout the day. A linear equation that represents the price of stock for Shipment Express is y = 15 – 1.5 x where x is the number of hours passed in an eight-hour day of trading. What are the slope and y -intercept? Interpret their meaning. The slope is –1.5 ( b = –1.5). This means the stock is losing value at a rate of $1.50 per hour. The y -intercept is $15 ( a = 15). This means the price of stock before the trading day was $15. If you owned this stock, would you want a positive or negative slope? Why? Homework For each of the following situations, state the independent variable and the dependent variable. A study is done to determine if elderly drivers are involved in more motor vehicle fatalities than other drivers. The number of fatalities per 100,000 drivers is compared to the age of drivers. A study is done to determine if the weekly grocery bill changes based on the number of family members. Insurance companies base life insurance premiums partially on the age of the applicant. Utility bills vary according to power consumption. A study is done to determine if a higher education reduces the crime rate in a population. independent variable: age; dependent variable: fatalities independent variable: # of family members; dependent variable: grocery bill independent variable: age of applicant; dependent variable: insurance premium independent variable: power consumption; dependent variable: utility independent variable: higher education (years); dependent variable: crime rates Piece-rate systems are widely debated incentive payment plans. In a recent study of loan officer effectiveness, the following piece-rate system was examined: % of goal reached < 80 80 100 120 Incentive n/a $4,000 with an additional $125 added per percentage point from 81–99% $6,500 with an additional $125 added per percentage point from 101–119% $9,500 with an additional $125 added per percentage point starting at 121% If a loan officer makes 95% of their goal, write the linear function that applies based on the incentive plan table. In context, explain the y -intercept and slope.

Math


Scatter Plots Before we take up the discussion of linear regression and correlation, we need to examine a way to display the relation between two variables x and y . The most common and easiest way is a scatter plot . The following example illustrates a scatter plot. An educational researcher collects data on the vocabulary size of children as a function of age. The data is shown in Table 12.1. Is there a relationship between age and vocabulary size for young children? Construct a scatter plot. Let x = Child’s Age, and let y = Vocabulary Size. Age (years) Vocabulary Size (number of words) 3 655 4 1098 6 2463 7 3195 To create a scatter plot: Enter your X data into list L1 and your Y data into list L2. Press 2nd STATPLOT ENTER to use Plot 1. On the input screen for PLOT 1, highlight On and press ENTER . (Make sure the other plots are OFF.) For TYPE: highlight the very first icon, which is the scatter plot, and press ENTER . For Xlist:, enter L1 ENTER and for Ylist: L2 ENTER. For Mark: it does not matter which symbol you highlight, but the square is the easiest to see. Press ENTER . Make sure there are no other equations that could be plotted. Press Y = and clear any equations out. Press the ZOOM key and then the number 9 (for menu item "ZoomStat") ; the calculator will fit the window to the data. You can press WINDOW to see the scaling of the axes. Try It Amelia plays basketball for her high school. She wants to improve to play at the college level. She notices that the number of points she scores in a game goes up in response to the number of hours she practices her jump shot each week. She records the following data: X (hours practicing jump shot) Y (points scored in a game) 5 15 7 22 9 28 10 31 11 33 12 36 Construct a scatter plot and state if what Amelia thinks appears to be true. A scatter plot shows the direction of a relationship between the variables. A clear direction happens when there is either: High values of one variable occurring with high values of the other variable or low values of one variable occurring with low values of the other variable. High values of one variable occurring with low values of the other variable. You can determine the strength of the relationship by looking at the scatter plot and seeing how close the points are to a line, a power function, an exponential function, or to some other type of function. For a linear relationship there is an exception. Consider a scatter plot where all the points fall on a horizontal line providing a "perfect fit." The horizontal line would in fact show no relationship. When you look at a scatterplot, you want to notice the overall pattern and any deviations from the pattern. The following scatterplot examples illustrate these concepts. In this chapter, we are interested in scatter plots that show a linear pattern. Linear patterns are quite common. The linear relationship is strong if the points are close to a straight line, except in the case of a horizontal line where there is no relationship. If we think that the points show a linear relationship, we would like to draw a line on the scatter plot. This line can be calculated through a process called linear regression . However, we only calculate a regression line if one of the variables helps to explain or predict the other variable. If x is the independent variable and y the dependent variable, then we can use a regression line to predict y for a given value of x Chapter Review Scatter plots are particularly helpful graphs when we want to see if there is a linear relationship among data points. They indicate both the direction of the relationship between the x variables and the y variables, and the strength of the relationship. We calculate the strength of the relationship between an independent variable and a dependent variable using linear regression. Does the scatter plot appear linear? Strong or weak? Positive or negative? The data appear to be linear with a strong, positive correlation. Does the scatter plot appear linear? Strong or weak? Positive or negative? Does the scatter plot appear linear? Strong or weak? Positive or negative? The data appear to have no correlation. Homework The Gross Domestic Product Purchasing Power Parity is an indication of a country’s currency value compared to another country. shows the GDP PPP of Cuba as compared to US dollars. Construct a scatter plot of the data. Year Cuba’s PPP Year Cuba’s PPP 1 1,700 8 4,000 2 1,700 9 11,000 4 2,300 10 9,500 5 2,900 11 9,700 6 3,000 12 9,900 7 3,500 Answers may vary. The following table shows the number of faculty and number of students at several colleges. Construct a scatter plot of the data College Faculty Students College A 47 940 College B 58 1102 College C 26 533 College D 63 1244 Does the higher cost of tuition translate into higher-paying jobs? The table lists the top ten colleges based on mid-career salary and the associated yearly tuition costs. Construct a scatter plot of the data. School Mid-Career Salary (in thousands) Yearly Tuition Princeton 137 57,410 Harvey Mudd 135 62,817 CalTech 127 60,864 US Naval Academy 122 0 West Point 120 0 MIT 118 57,986 Lehigh University 118 59,930 NYU-Poly 117 58,168 Babson College 117 56,576 Stanford 114 56,169 For graph: Answers may vary. Note that tuition is the independent variable and salary is the dependent variable. If the level of significance is 0.05 and the p -value is 0.06, what conclusion can you draw? If there are 15 data points in a set of data, what is the number of degree of freedom? 13

Math


The Regression Equation Data rarely fit a straight line exactly. Usually, you must be satisfied with rough predictions. Typically, you have a set of data whose scatter plot appears to "fit" a straight line. This is called a Line of Best Fit or Least-Squares Line . If you know a person's pinky (smallest) finger length, do you think you could predict that person's height? Collect data from your class (pinky finger length, in inches). The independent variable, x , is pinky finger length and the dependent variable, y , is height. For each set of data, plot the points on graph paper. Make your graph big enough and use a ruler . Then "by eye" draw a line that appears to "fit" the data. For your line, pick two convenient points and use them to find the slope of the line. Find the y -intercept of the line by extending your line so it crosses the y -axis. Using the slopes and the y -intercepts, write your equation of "best fit." Do you think everyone will have the same equation? Why or why not? According to your equation, what is the predicted height for a pinky length of 2.5 inches? A random sample of 11 statistics students produced the following data, where x is the third exam score out of 80, and y is the final exam score out of 200. Can you predict the final exam score of a random student if you know the third exam score? x (third exam score) y (final exam score) 65 175 67 133 71 185 71 163 66 126 75 198 67 153 70 163 71 159 69 151 69 159 Table showing the scores on the final exam based on scores from the third exam. Scatter plot showing the scores on the final exam based on scores from the third exam. Try It SCUBA divers have maximum dive times they cannot exceed when going to different depths. The data in show different depths with the maximum dive times in minutes. Use your calculator to find the least squares regression line and predict the maximum dive time for 110 feet. X (depth in feet) Y (maximum dive time) 50 80 60 55 70 45 80 35 90 25 100 22 The third exam score, x , is the independent variable and the final exam score, y , is the dependent variable. We will plot a regression line that best "fits" the data. If each of you were to fit a line "by eye," you would draw different lines. We can use what is called a least-squares regression line to obtain the best fit line. Consider the following diagram. Each point of data is of the the form ( x , y ) and each point of the line of best fit using least-squares linear regression has the form ( x , ŷ ). The ŷ is read " y hat" and is the estimated value of y . It is the value of y obtained using the regression line. It is not generally equal to y from data. The term y 0 – ŷ 0 = ε 0 is called the "error" or residual . It is not an error in the sense of a mistake. The absolute value of a residual measures the vertical distance between the actual value of y and the estimated value of y . In other words, it measures the vertical distance between the actual data point and the predicted point on the line. If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for y . If the observed data point lies below the line, the residual is negative, and the line overestimates that actual data value for y . In the diagram in , y 0 – ŷ 0 = ε 0 is the residual for the point shown. Here the point lies above the line and the residual is positive. ε = the Greek letter epsilon For each data point, you can calculate the residuals or errors, y i - ŷ i = ε i for i = 1, 2, 3, ..., 11. Each | ε | is a vertical distance. For the example about the third exam scores and the final exam scores for the 11 statistics students, there are 11 data points. Therefore, there are 11 ε values. If you square each ε and add, you get ( ε 1 ) 2 + ( ε 2 ) 2 + ... + ( ε 11 ) 2 = Σ i = 1 11 ε 2 This is called the Sum of Squared Errors (SSE) . Using calculus, you can determine the values of a and b that make the SSE a minimum. When you make the SSE a minimum, you have determined the points that are on the line of best fit. It turns out that the line of best fit has the equation: y ^ = a + b x where a = y ¯ − b x ¯ and b = Σ ( x − x ¯ ) ( y − y ¯ ) Σ ( x − x ¯ ) 2 . The sample means of the x values and the y values are x ¯ and y ¯ , respectively. The best fit line always passes through the point ( x ¯ , y ¯ ) . The slope b can be written as b = r ( s y s x ) where s y = the standard deviation of the y values and s x = the standard deviation of the x values. r is the correlation coefficient, which is discussed in the next section. Residuals Plots A residuals plot can be used to help determine if a set of ( x , y ) data is linearly correlated. For each data point used to create the correlation line, a residual y - ŷ can be calculated, where y is the observed value of the response variable and ŷ is the value predicted by the correlation line. The difference between these values is called the residual. A residuals plot shows the explanatory variable x on the horizontal axis and the residual for that value on the vertical axis. The residuals plot is often shown together with a scatter plot of the data. While a scatter plot of the data should resemble a straight line, a residuals plot should appear random, with no pattern and no outliers. It should also show constant error variance, meaning the residuals should not consistently increase (or decrease) as the explanatory variable x increases. A residuals plot can be created using StatCrunch or a TI calculator. The plot should appear random. A box plot of the residuals is also helpful to verify that there are no outliers in the data. By observing the scatter plot of the data, the residuals plot, and the box plot of residuals, together with the linear correlation coefficient, we can usually determine if it is reasonable to conclude that the data are linearly correlated. EXAMPLE: A shop owner uses a straight-line regression to estimate the number of ice cream cones that would be sold in a day based on the temperature at noon. The owner has data for a 2-year period and chose nine days at random. A scatter plot of the data is shown, together with a residuals plot. Temperature ° F Ice cream cones sold 70 105 85 240 65 49 72 147 80 231 61 38 75 193 78 196 68 89 Table showing the number of ice cream cones sold on nine random days and the temperature at noon on those days. Scatter plot of the data looks like a straight line. Residuals plot appears random. Least Squares Criteria for Best Fit The process of fitting the best-fit line is called linear regression . The idea behind finding the best-fit line is based on the assumption that the data are scattered about a straight line. The criteria for the best fit line is that the sum of the squared errors (SSE) is minimized, that is, made as small as possible. Any other line you might choose would have a higher SSE than the best fit line. This best fit line is called the least-squares regression line . NOTE Computer spreadsheets, statistical software, and many calculators can quickly calculate the best-fit line and create the graphs. The calculations tend to be tedious if done by hand. Instructions to use the TI-83, TI-83+, and TI-84+ calculators to find the best-fit line and create a scatterplot are shown at the end of this section. THIRD EXAM vs FINAL EXAM EXAMPLE: The graph of the line of best fit for the third-exam/final-exam example is as follows: The least squares regression line (best-fit line) for the third-exam/final-exam example has the equation: y ^ = − 173.51 + 4.83 x REMINDER Remember, it is always important to plot a scatter diagram first. If the scatter plot indicates that there is a linear relationship between the variables, then it is reasonable to use a best fit line to make predictions for y given x within the domain of x -values in the sample data, but not necessarily for x -values outside that domain. You could use the line to predict the final exam score for a student who earned a grade of 73 on the third exam. You should NOT use the line to predict the final exam score for a student who earned a grade of 50 on the third exam, because 50 is not within the domain of the x -values in the sample data, which are between 65 and 75. UNDERSTANDING SLOPE The slope of the line, b , describes how changes in the variables are related. It is important to interpret the slope of the line in the context of the situation represented by the data. You should be able to write a sentence interpreting the slope in plain English. INTERPRETATION OF THE SLOPE: The slope of the best-fit line tells us how the dependent variable ( y ) changes for every one unit increase in the independent ( x ) variable, on average. THIRD EXAM vs FINAL EXAM EXAMPLE Slope: The slope of the line is b = 4.83. Interpretation: For a one-point increase in the score on the third exam, the final exam score increases by 4.83 points, on average. Using the Linear Regression T Test: LinRegTTest In the STAT list editor, enter the X data in list L1 and the Y data in list L2 , paired so that the corresponding ( x , y ) values are next to each other in the lists. (If a particular pair of values is repeated, enter it as many times as it appears in the data.) On the STAT TESTS menu, scroll down with the cursor to select the LinRegTTest . (Be careful to select LinRegTTest , as some calculators may also have a different item called LinRegTInt.) On the LinRegTTest input screen enter: Xlist: L1 ; Ylist: L2 ; Freq: 1 On the next line, at the prompt β or ρ , highlight "≠ 0" and press ENTER Leave the line for "RegEq:" blank Highlight Calculate and press ENTER. The output screen contains a lot of information. For now we will focus on a few items from the output, and will return later to the other items. The second line says y = a + bx . Scroll down to find the values a = –173.513, and b = 4.8273; the equation of the best fit line is ŷ = –173.51 + 4.83 x The two items at the bottom are r 2 = 0.43969 and r = 0.663. For now, just note where to find these values; we will discuss them in the next two sections. Graphing the Scatterplot and Regression Line We are assuming your X data is already entered in list L1 and your Y data is in list L2 Press 2nd STATPLOT ENTER to use Plot 1 On the input screen for PLOT 1, highlight On , and press ENTER For TYPE: highlight the very first icon which is the scatterplot and press ENTER Indicate Xlist: L1 and Ylist: L2 For Mark: it does not matter which symbol you highlight. Press the ZOOM key and then the number 9 (for menu item "ZoomStat") ; the calculator will fit the window to the data To graph the best-fit line, press the "Y=" key and type the equation –173.5 + 4.83X into equation Y1. (The X key is immediately left of the STAT key). Press ZOOM 9 again to graph it. Optional: If you want to change the viewing window, press the WINDOW key. Enter your desired window using Xmin, Xmax, Ymin, Ymax NOTE Another way to graph the line after you create a scatter plot is to use LinRegTTest. Make sure you have done the scatter plot. Check it on your screen. Go to LinRegTTest and enter the lists. At RegEq: press VARS and arrow over to Y-VARS. Press 1 for 1:Function. Press 1 for 1:Y1. Then arrow down to Calculate and do the calculation for the line of best fit. Press Y = (you will see the regression equation). Press GRAPH. The line will be drawn." The Correlation Coefficient r Besides looking at the scatter plot and seeing that a line seems reasonable, how can you tell if the line is a good predictor? Use the correlation coefficient as another indicator (besides the scatterplot) of the strength of the relationship between x and y . The correlation coefficient, r , developed by Karl Pearson in the early 1900s, is numerical and provides a measure of strength and direction of the linear association between the independent variable x and the dependent variable y . The correlation coefficient is calculated as r = n Σ ( x y ) − ( Σ x ) ( Σ y ) [ n Σ x 2 − ( Σ x ) 2 ] [ n Σ y 2 − ( Σ y ) 2 ] where n = the number of data points. If you suspect a linear relationship between x and y , then r can measure how strong the linear relationship is. What the VALUE of r tells us: The value of r is always between –1 and +1: –1 ≤ r ≤ 1. The size of the correlation r indicates the strength of the linear relationship between x and y . Values of r close to –1 or to +1 indicate a stronger linear relationship between x and y . If r = 0 there is likely no linear correlation. It is important to view the scatterplot, however, because data that exhibit a curved or horizontal pattern may have a correlation of 0. If r = 1, there is perfect positive correlation. If r = –1, there is perfect negative correlation. In both these cases, all of the original data points lie on a straight line. Of course,in the real world, this will not generally happen. What the SIGN of r tells us A positive value of r means that when x increases, y tends to increase and when x decreases, y tends to decrease (positive correlation) . A negative value of r means that when x increases, y tends to decrease and when x decreases, y tends to increase (negative correlation) . The sign of r is the same as the sign of the slope, b , of the best-fit line. NOTE Strong correlation does not suggest that x causes y or y causes x . We say "correlation does not imply causation." (a) A scatter plot showing data with a positive correlation. 0 < r < 1 (b) A scatter plot showing data with a negative correlation. –1 < r < 0 (c) A scatter plot showing data with zero correlation. r = 0 The formula for r looks formidable. However, computer spreadsheets, statistical software, and many calculators can quickly calculate r . The correlation coefficient r is the bottom item in the output screens for the LinRegTTest on the TI-83, TI-83+, or TI-84+ calculator (see previous section for instructions). The Coefficient of Determination The variable r 2 is called the coefficient of determination and is the square of the correlation coefficient, but is usually stated as a percent, rather than in decimal form. It has an interpretation in the context of the data: r 2 , when expressed as a percent, represents the percent of variation in the dependent (predicted) variable y that can be explained by variation in the independent (explanatory) variable x using the regression (best-fit) line. 1 – r 2 , when expressed as a percentage, represents the percent of variation in y that is NOT explained by variation in x using the regression line. This can be seen as the scattering of the observed data points about the regression line. Consider the third exam/final exam example introduced in the previous section The line of best fit is: ŷ = –173.51 + 4.83x The correlation coefficient is r = 0.6631 The coefficient of determination is r 2 = 0.6631 2 = 0.4397 Interpretation of r 2 in the context of this example: Approximately 44% of the variation (0.4397 is approximately 0.44) in the final-exam grades can be explained by the variation in the grades on the third exam, using the best-fit regression line. Therefore, approximately 56% of the variation (1 – 0.44 = 0.56) in the final exam grades can NOT be explained by the variation in the grades on the third exam, using the best-fit regression line. (This is seen as the scattering of the points about the line.) Chapter Review A regression line, or a line of best fit, can be drawn on a scatter plot and used to predict outcomes for the x and y variables in a given data set or sample data. There are several ways to find a regression line, but usually the least-squares regression line is used because it creates a uniform line. Residuals, also called “errors,” measure the distance from the actual value of y and the estimated value of y . The Sum of Squared Errors, when set to its minimum, calculates the points on the line of best fit. Regression lines can be used to predict values within the given set of data, but should not be used to make predictions for values outside the set of data. The correlation coefficient r measures the strength of the linear association between x and y . The variable r has to be between –1 and +1. When r is positive, the x and y will tend to increase and decrease together. When r is negative, x will increase and y will decrease, or the opposite, x will decrease and y will increase. The coefficient of determination r 2 , is equal to the square of the correlation coefficient. When expressed as a percent, r 2 represents the percent of variation in the dependent variable y that can be explained by variation in the independent variable x using the regression line. Use the following information to answer the next five exercises . A random sample of ten professional athletes produced the following data where x is the number of endorsements the player has and y is the amount of money made (in millions of dollars). x y x y 0 2 5 12 3 8 4 9 2 7 3 9 1 3 0 3 5 13 4 10 Draw a scatter plot of the data. Use regression to find the equation for the line of best fit. ŷ = 2.23 + 1.99 x Draw the line of best fit on the scatter plot. What is the slope of the line of best fit? What does it represent? The slope is 1.99 ( b = 1.99). It means that for every endorsement deal a professional player gets, he gets an average of another $1.99 million in pay each year. What is the y -intercept of the line of best fit? What does it represent? What does an r value of zero mean? It means that there is no correlation between the data sets. When n = 2 and r = 1, are the data significant? Explain. When n = 100 and r = -0.89, is there a significant correlation? Explain. Yes, there are enough data points and the value of r is strong enough to show that there is a strong negative correlation between the data sets. Homework What is the process through which we can calculate a line that goes through a scatter plot with a linear pattern? Explain what it means when a correlation has an r 2 of 0.72. It means that 72% of the variation in the dependent variable ( y ) can be explained by the variation in the independent variable ( x ). Can a coefficient of determination be negative? Why or why not?

Math


Testing the Significance of the Correlation Coefficient The correlation coefficient, r , tells us about the strength and direction of the linear relationship between x and y . However, the reliability of the linear model also depends on how many observed data points are in the sample. We need to look at both the value of the correlation coefficient r and the sample size n , together. We perform a hypothesis test of the "significance of the correlation coefficient" to decide whether the linear relationship in the sample data is strong enough to use to model the relationship in the population. The sample data are used to compute r , the correlation coefficient for the sample. If we had data for the entire population, we could find the population correlation coefficient. But because we have only sample data, we cannot calculate the population correlation coefficient. The sample correlation coefficient, r , is our estimate of the unknown population correlation coefficient. The symbol for the population correlation coefficient is ρ , the Greek letter "rho." ρ = population correlation coefficient (unknown) r = sample correlation coefficient (known; calculated from sample data) The hypothesis test lets us decide whether the value of the population correlation coefficient ρ is "close to zero" or "significantly different from zero". We decide this based on the sample correlation coefficient r and the sample size n . If the test concludes that the correlation coefficient is significantly different from zero, we say that the correlation coefficient is "significant." Conclusion: There is sufficient evidence to conclude that there is a significant linear relationship between x and y because the correlation coefficient is significantly different from zero. What the conclusion means: There is a significant linear relationship between x and y . We can use the regression line to model the linear relationship between x and y in the population. If the test concludes that the correlation coefficient is not significantly different from zero (it is close to zero), we say that correlation coefficient is "not significant". Conclusion: "There is insufficient evidence to conclude that there is a significant linear relationship between x and y because the correlation coefficient is not significantly different from zero." What the conclusion means: There is not a significant linear relationship between x and y . Therefore, we CANNOT use the regression line to model a linear relationship between x and y in the population. NOTE If r is significant and the scatter plot shows a linear trend, the line can be used to predict the value of y for values of x that are within the domain of observed x values. If r is not significant OR if the scatter plot does not show a linear trend, the line should not be used for prediction. If r is significant and if the scatter plot shows a linear trend, the line may NOT be appropriate or reliable for prediction OUTSIDE the domain of observed x values in the data. PERFORMING THE HYPOTHESIS TEST Null Hypothesis: H 0 : ρ = 0 Alternate Hypothesis: H a : ρ ≠ 0 WHAT THE HYPOTHESES MEAN IN WORDS: Null Hypothesis H 0 : The population correlation coefficient IS NOT significantly different from zero. There IS NOT a significant linear relationship (correlation) between x and y in the population. Alternate Hypothesis H a : The population correlation coefficient IS significantly DIFFERENT FROM zero. There IS A SIGNIFICANT LINEAR RELATIONSHIP (correlation) between x and y in the population. DRAWING A CONCLUSION: There are two methods of making the decision. The two methods are equivalent and give the same result. Method 1: Using the p -value Method 2: Using a table of critical values In this chapter of this textbook, we will always use a significance level of 5%, α = 0.05 NOTE Using the p -value method, you could choose any appropriate significance level you want; you are not limited to using α = 0.05. But the table of critical values provided in this textbook assumes that we are using a significance level of 5%, α = 0.05. (If we wanted to use a different significance level than 5% with the critical value method, we would need different tables of critical values that are not provided in this textbook.) METHOD 1: Using a p -value to make a decision To calculate the p -value using LinRegTTEST : On the LinRegTTEST input screen, on the line prompt for β or ρ , highlight " ≠ 0 " The output screen shows the p-value on the line that reads "p =". (Most computer statistical software can calculate the p -value.) If the p -value is less than the significance level ( α = 0.05): Decision: Reject the null hypothesis. Conclusion: "There is sufficient evidence to conclude that there is a significant linear relationship between x and y because the correlation coefficient is significantly different from zero." If the p -value is NOT less than the significance level ( α = 0.05) Decision: DO NOT REJECT the null hypothesis. Conclusion: "There is insufficient evidence to conclude that there is a significant linear relationship between x and y because the correlation coefficient is NOT significantly different from zero." Calculation Notes: You will use technology to calculate the p -value. The following describes the calculations to compute the test statistics and the p -value: The p -value is calculated using a t -distribution with n - 2 degrees of freedom. The formula for the test statistic is t = r n − 2 1 − r 2 . The value of the test statistic, t , is shown in the computer or calculator output along with the p -value. The test statistic t has the same sign as the correlation coefficient r . The p -value is the combined area in both tails. An alternative way to calculate the p -value (p) given by LinRegTTest is the command 2*tcdf(abs(t),10^99, n-2) in 2nd DISTR. THIRD-EXAM vs FINAL-EXAM EXAMPLE: p -value method Consider the third exam/final exam example . The line of best fit is: ŷ = -173.51 + 4.83 x with r = 0.6631 and there are n = 11 data points. Can the regression line be used for prediction? Given a third exam score ( x value), can we use the line to predict the final exam score (predicted y value)? H 0 : ρ = 0 H a : ρ ≠ 0 α = 0.05 The p -value is 0.026 (from LinRegTTest on your calculator or from computer software). The p -value, 0.026, is less than the significance level of α = 0.05. Decision: Reject the Null Hypothesis H 0 Conclusion: There is sufficient evidence to conclude that there is a significant linear relationship between the third exam score ( x ) and the final exam score ( y ) because the correlation coefficient is significantly different from zero. Because r is significant and the scatter plot shows a linear trend, the regression line can be used to predict final exam scores. METHOD 2: Using a table of Critical Values to make a decision The 95% Critical Values of the Sample Correlation Coefficient Table can be used to give you a good idea of whether the computed value of r is significant or not . Compare r to the appropriate critical value in the table. If r is not between the positive and negative critical values, then the correlation coefficient is significant. If r is significant, then you may want to use the line for prediction. Suppose you computed r = 0.801 using n = 10 data points. df = n - 2 = 10 - 2 = 8. The critical values associated with df = 8 are -0.632 and + 0.632. If r < negative critical value or r > positive critical value, then r is significant. Since r = 0.801 and 0.801 > 0.632, r is significant and the line may be used for prediction. If you view this example on a number line, it will help you. r is not significant between -0.632 and +0.632. r = 0.801 > +0.632. Therefore, r is significant. Try It For a given line of best fit, you computed that r = 0.6501 using n = 12 data points and the critical value is 0.576. Can the line be used for prediction? Why or why not? Suppose you computed r = –0.624 with 14 data points. df = 14 – 2 = 12. The critical values are –0.532 and 0.532. Since –0.624 < –0.532, r is significant and the line can be used for prediction r = –0.624 < -0.532. Therefore, r is significant. Try It For a given line of best fit, you compute that r = 0.5204 using n = 9 data points, and the critical value is 0.666. Can the line be used for prediction? Why or why not? Suppose you computed r = 0.776 and n = 6. df = 6 – 2 = 4. The critical values are –0.811 and 0.811. Since –0.811 < 0.776 < 0.811, r is not significant, and the line should not be used for prediction. -0.811 < r = 0.776 < 0.811. Therefore, r is not significant. Try It For a given line of best fit, you compute that r = –0.7204 using n = 8 data points, and the critical value is = 0.707. Can the line be used for prediction? Why or why not? THIRD-EXAM vs FINAL-EXAM EXAMPLE: critical value method Consider the third exam/final exam example . The line of best fit is: ŷ = –173.51+4.83 x with r = 0.6631 and there are n = 11 data points. Can the regression line be used for prediction? Given a third-exam score ( x value), can we use the line to predict the final exam score (predicted y value)? H 0 : ρ = 0 H a : ρ ≠ 0 α = 0.05 Use the "95% Critical Value" table for r with df = n – 2 = 11 – 2 = 9. The critical values are –0.602 and +0.602 Since 0.6631 > 0.602, r is significant. Decision: Reject the null hypothesis. Conclusion:There is sufficient evidence to conclude that there is a significant linear relationship between the third exam score ( x ) and the final exam score ( y ) because the correlation coefficient is significantly different from zero. Because r is significant and the scatter plot shows a linear trend, the regression line can be used to predict final exam scores. Suppose you computed the following correlation coefficients. Using the table at the end of the chapter, determine if r is significant and the line of best fit associated with each r can be used to predict a y value. If it helps, draw a number line. r = –0.567 and the sample size, n , is 19. The df = n – 2 = 17. The critical value is –0.456. –0.567 < –0.456 so r is significant. r = 0.708 and the sample size, n , is nine. The df = n – 2 = 7. The critical value is 0.666. 0.708 > 0.666 so r is significant. r = 0.134 and the sample size, n , is 14. The df = 14 – 2 = 12. The critical value is 0.532. 0.134 is between –0.532 and 0.532 so r is not significant. r = 0 and the sample size, n , is five. No matter what the dfs are, r = 0 is between the two critical values so r is not significant. Try It For a given line of best fit, you compute that r = 0 using n = 100 data points. Can the line be used for prediction? Why or why not? Assumptions in Testing the Significance of the Correlation Coefficient Testing the significance of the correlation coefficient requires that certain assumptions about the data are satisfied. The premise of this test is that the data are a sample of observed points taken from a larger population. We have not examined the entire population because it is not possible or feasible to do so. We are examining the sample to draw a conclusion about whether the linear relationship that we see between x and y in the sample data provides strong enough evidence so that we can conclude that there is a linear relationship between x and y in the population. The regression line equation that we calculate from the sample data gives the best-fit line for our particular sample. We want to use this best-fit line for the sample as an estimate of the best-fit line for the population. Examining the scatterplot and testing the significance of the correlation coefficient helps us determine if it is appropriate to do this. The assumptions underlying the test of significance are: The relationship between the variables being correlated should be linear. The data points should fall along an approximate straight-line pattern when plotted as ( x , y ) data points on a scatter plot. The y values for any particular x value are normally distributed about the line. This implies that there are more y values scattered closer to the line than are scattered farther away. Assumption (1) implies that these normal distributions are centered on the line: the means of these normal distributions of y values lie on the line. The standard deviations of the population y values about the line are equal for each value of x . In other words, each of these normal distributions of y values has the same shape and spread about the line. The residual errors are mutually independent (no pattern). The data are produced from a well-designed, random sample or randomized experiment. The y values for each x value are normally distributed about the line with the same standard deviation. For each x value, the mean of the y values lies on the regression line. More y values lie near the line than are scattered further away from the line. Chapter Review Linear regression is a procedure for fitting a straight line of the form ŷ = a + bx to data. The conditions for regression are: Linear In the population, there is a linear relationship that models the average value of y for different values of x . Independent The residuals are assumed to be independent. Normal The y values are distributed normally for any value of x . Equal variance The standard deviation of the y values is equal for each x value. Random The data are produced from a well-designed random sample or randomized experiment. The slope b and intercept a of the least-squares line estimate the slope β and intercept α of the population (true) regression line. To estimate the population standard deviation of y , σ , use the standard deviation of the residuals, s . s = S E E n − 2 . The variable ρ (rho) is the population correlation coefficient. To test the null hypothesis H 0 : ρ = hypothesized value , use a linear regression t-test. The most common null hypothesis is H 0 : ρ = 0 which indicates there is no linear relationship between x and y in the population. The TI-83, 83+, 84, 84+ calculator function LinRegTTest can perform this test (STATS TESTS LinRegTTest). Formula Review Least Squares Line or Line of Best Fit: y ^ = a + b x where a = y -intercept b = slope Standard deviation of the residuals: s = S E E n − 2 . where SSE = sum of squared errors n = the number of data points When testing the significance of the correlation coefficient, what is the null hypothesis? When testing the significance of the correlation coefficient, what is the alternative hypothesis? H a : ρ ≠ 0 If the level of significance is 0.05 and the p -value is 0.04, what conclusion can you draw?

Math


Prediction Recall the third exam/final exam example . We examined the scatterplot and showed that the correlation coefficient is significant. We found the equation of the best-fit line for the final exam grade as a function of the grade on the third-exam. We can now use the least-squares regression line for prediction. Suppose you want to estimate, or predict, the mean final exam score of statistics students who received 73 on the third exam. The exam scores ( x -values) range from 65 to 75. Since 73 is between the x -values 65 and 75 , substitute x = 73 into the equation. Then: y ^ = − 173.51 + 4.83 ( 73 ) = 179.08 We predict that statistics students who earn a grade of 73 on the third exam will earn a grade of 179.08 on the final exam, on average. Recall the third exam/final exam example . a. What would you predict the final exam score to be for a student who scored a 66 on the third exam? b. What would you predict the final exam score to be for a student who scored a 90 on the third exam? a. 145.27 b. The x values in the data are between 65 and 75. Ninety is outside of the domain of the observed x values in the data (independent variable), so you cannot reliably predict the final exam score for this student. (Even though it is possible to enter 90 into the equation for x and calculate a corresponding y value, the y value that you get will not be reliable.) To understand really how unreliable the prediction can be outside of the observed x values observed in the data, make the substitution x = 90 into the equation. y ^ = –173.51 + 4.83 ( 90 ) = 261.19 The final-exam score is predicted to be 261.19. The largest the final-exam score can be is 200. NOTE The process of predicting inside of the observed x values observed in the data is called interpolation . The process of predicting outside of the observed x values observed in the data is called extrapolation . Try It Data are collected on the relationship between the number of hours per week practicing a musical instrument and scores on a math test. The line of best fit is as follows: ŷ = 72.5 + 2.8 x What would you predict the score on a math test would be for a student who practices a musical instrument for five hours a week? References Data from the Centers for Disease Control and Prevention. Data from the National Center for agency reporting flu cases and TB Prevention. Data from the United States Census Bureau. Available online at http://www.census.gov/compendia/statab/cats/transportation/motor_vehicle_accidents_and_fatalities.html Data from the National Center for Health Statistics. Chapter Review After determining the presence of a strong correlation coefficient and calculating the line of best fit, you can use the least squares regression line to make predictions about your data. Use the following information to answer the next two exercises . An electronics retailer used regression to find a simple model to predict sales growth in the first quarter of the new year (January through March). The model is good for 90 days, where x is the day. The model can be written as follows: ŷ = 101.32 + 2.48 x where ŷ is in thousands of dollars. What would you predict the sales to be on day 60? $250,120 What would you predict the sales to be on day 90? Use the following information to answer the next three exercises . A landscaping company is hired to mow the grass for several large properties. The total area of the properties combined is 1,350 acres. The rate at which one person can mow is as follows: ŷ = 1350 – 1.2 x where x is the number of hours and ŷ represents the number of acres left to mow. How many acres will be left to mow after 20 hours of work? 1,326 acres How many acres will be left to mow after 100 hours of work? How many hours will it take to mow all of the lawns? (When is ŷ = 0?) 1,125 hours, or when x = 1,125 contains real data for the first two decades of flu cases reporting. Adults and Adolescents only, United States Year # flu cases diagnosed # flu deaths Pre-1981 91 29 1981 319 121 1982 1,170 453 1983 3,076 1,482 1984 6,240 3,466 1985 11,776 6,878 1986 19,032 11,987 1987 28,564 16,162 1988 35,447 20,868 1989 42,674 27,591 1990 48,634 31,335 1991 59,660 36,560 1992 78,530 41,055 1993 78,834 44,730 1994 71,874 49,095 1995 68,505 49,456 1996 59,347 38,510 1997 47,149 20,736 1998 38,393 19,005 1999 25,174 18,454 2000 25,522 17,347 2001 25,643 17,402 2002 26,464 16,371 Total 802,118 489,093 Graph “year” versus “# flu cases diagnosed” (plot the scatter plot). Do not include pre-1981 data. Perform linear regression. What is the linear equation? Round to the nearest whole number. Answers may vary. Find the correlation coefficient. r = ________ Solve. When x = 1985, ŷ = _____ When x = 1990, ŷ =_____ When x = 1970, ŷ =______ Why doesn’t this answer make sense? When x = 1985, ŷ = 25,52 When x = 1990, ŷ = 34,275 When x = 1970, ŷ = –725 Why doesn’t this answer make sense? The range of x values was 1981 to 2002; the year 1970 is not in this range. The regression equation does not apply, because predicting for the year 1970 is extrapolation, which requires a different process. Also, a negative number does not make sense in this context, where we are predicting flu cases diagnosed. Does the line seem to fit the data? Why or why not? What does the correlation imply about the relationship between time (years) and the number of diagnosed flu cases reported in the U.S.? Also, the correlation r = 0.4526. If r is compared to the value in the 95% Critical Values of the Sample Correlation Coefficient Table, because r > 0.423, r is significant, and you would think that the line could be used for prediction. But the scatter plot indicates otherwise. Plot the two given points on the following graph. Then, connect the two points to form the regression line. Obtain the graph on your calculator or computer. Write the equation: ŷ = ____________ y ^ = –3,448,225 + 1750 x Hand draw a smooth curve on the graph that shows the flow of the data. Does the line seem to fit the data? Why or why not? There was an increase in flu cases diagnosed until 1993. From 1993 through 2002, the number of flu cases diagnosed declined each year. It is not appropriate to use a linear regression line to fit to the data. Do you think a linear fit is best? Why or why not? What does the correlation imply about the relationship between time (years) and the number of diagnosed flu cases reported in the U.S.? Since there is no linear association between year and # of flu cases diagnosed, it is not appropriate to calculate a linear correlation coefficient. When there is a linear association and it is appropriate to calculate a correlation, we cannot say that one variable “causes” the other variable. Graph “year” vs. “# flu cases diagnosed.” Do not include pre-1981. Label both axes with words. Scale both axes. Enter your data into your calculator or computer. The pre-1981 data should not be included. Why is that so? Write the linear equation, rounding to four decimal places: We don’t know if the pre-1981 data was collected from a single year. So we don’t have an accurate x value for this figure. Regression equation: ŷ (#Flu Cases) = –3,448,225 + 1749.777 (year) Coefficients Intercept –3,448,225 X Variable 1 1,749.777 Find the correlation coefficient. correlation = _____ Homework Recently, the annual number of driver deaths per 100,000 for the selected age groups was as follows: Age Number of Driver Deaths per 100,000 16–19 38 20–24 36 25–34 24 35–54 20 55–74 18 75+ 28 For each age group, pick the midpoint of the interval for the x value. (For the 75+ group, use 80.) Using “ages” as the independent variable and “Number of driver deaths per 100,000” as the dependent variable, make a scatter plot of the data. Calculate the least squares (best–fit) line. Put the equation in the form of: ŷ = a + bx Find the correlation coefficient. Is it significant? Predict the number of deaths for ages 40 and 60. Based on the given data, is there a linear relationship between age of a driver and driver fatality rate? What is the slope of the least squares (best-fit) line? Interpret the slope. Age Number of Driver Deaths per 100,000 16–19 38 20–24 36 25–34 24 35–54 20 55–74 18 75+ 28 Check student’s solution. ŷ = 35.5818045 – 0.19182491 x r = –0.57874 For four df and alpha = 0.05, the LinRegTTest gives p -value = 0.2288 so we do not reject the null hypothesis; there is not a significant linear relationship between deaths and age. Using the table of critical values for the correlation coefficient, with four df , the critical value is 0.811. The correlation coefficient r = –0.57874 is not less than –0.811, so we do not reject the null hypothesis. There is not a linear relationship between the two variables, as evidenced by a p-value greater than 0.05. shows the life expectancy for an individual born in the United States in certain years. Year of Birth Life Expectancy 1930 59.7 1940 62.9 1950 70.2 1965 69.7 1973 71.4 1982 74.5 1987 75 1992 75.7 2010 78.7 Decide which variable should be the independent variable and which should be the dependent variable. Draw a scatter plot of the ordered pairs. Calculate the least squares line. Put the equation in the form of: ŷ = a + bx Find the correlation coefficient. Is it significant? Find the estimated life expectancy for an individual born in 1950 and for one born in 1982. Why aren’t the answers to part e the same as the values in that correspond to those years? Use the two points in part e to plot the least squares line on your graph from part b. Based on the data, is there a linear relationship between the year of birth and life expectancy? Are there any outliers in the data? Using the least squares line, find the estimated life expectancy for an individual born in 1850. Does the least squares line give an accurate estimate for that year? Explain why or why not. What is the slope of the least-squares (best-fit) line? Interpret the slope. The maximum discount value of the Entertainment® card for the “Fine Dining” section, Edition ten, for various pages is given in Page number Maximum value ($) 4 16 14 19 25 15 32 17 43 19 57 15 72 16 85 15 90 17 Decide which variable should be the independent variable and which should be the dependent variable. Draw a scatter plot of the ordered pairs. Calculate the least-squares line. Put the equation in the form of: ŷ = a + bx Find the correlation coefficient. Is it significant? Find the estimated maximum values for the restaurants on page ten and on page 70. Does it appear that the restaurants giving the maximum value are placed in the beginning of the “Fine Dining” section? How did you arrive at your answer? Suppose that there were 200 pages of restaurants. What do you estimate to be the maximum value for a restaurant listed on page 200? Is the least squares line valid for page 200? Why or why not? What is the slope of the least-squares (best-fit) line? Interpret the slope. We wonder if the better discounts appear earlier in the book so we select page as X and discount as Y . Check student’s solution. ŷ = 17.21757 – 0.01412 x r = – 0.2752 For seven df and alpha = 0.05, using LinRegTTest p -value = 0.4736 so we do not reject; there is a not a significant linear relationship between page and discount. Using the table of critical values for the correlation coefficient, with seven df , the critical value is 0.666. The correlation coefficient xi = –0.2752 is not less than 0.666 so we do not reject. There is not a significant linear correlation so it appears there is no relationship between the page and the amount of the discount. As the page number increases by one page, the discount decreases by $0.01412 gives the gold medal times for every other Summer Olympics for the women’s 100-meter freestyle (swimming). Year Time (seconds) 1912 82.2 1924 72.4 1932 66.8 1952 66.8 1960 61.2 1968 60.0 1976 55.65 1984 55.92 1992 54.64 2000 53.8 2008 53.1 2016 52.7 Decide which variable should be the independent variable and which should be the dependent variable. Draw a scatter plot of the data. Does it appear from inspection that there is a relationship between the variables? Why or why not? Calculate the least squares line. Put the equation in the form of: ŷ = a + bx . Find the correlation coefficient. Is the decrease in times significant? Find the estimated gold medal time for 1932. Find the estimated time for 1984. Why are the answers from part f different from the chart values? Does it appear that a line is the best way to fit the data? Why or why not? Use the least-squares line to estimate the gold medal time for the next Summer Olympics. Do you think that your answer is reasonable? Why or why not? State # letters in name Year entered the Union Rank for entering the Union Area (square miles) Alabama 7 1819 22 52,423 Colorado 8 1876 38 104,100 Hawaii 6 1959 50 10,932 Iowa 4 1846 29 56,276 Maryland 8 1788 7 12,407 Missouri 8 1821 24 69,709 New Jersey 9 1787 3 8,722 Ohio 4 1803 17 44,828 South Carolina 13 1788 8 32,008 Utah 4 1896 45 84,904 Wisconsin 9 1848 30 65,499 We are interested in whether or not the number of letters in a state name depends upon the year the state entered the Union. Decide which variable should be the independent variable and which should be the dependent variable. Draw a scatter plot of the data. Does it appear from inspection that there is a relationship between the variables? Why or why not? Calculate the least-squares line. Put the equation in the form of: ŷ = a + bx . Find the correlation coefficient. What does it imply about the significance of the relationship? Find the estimated number of letters (to the nearest integer) a state would have if it entered the Union in 1900. Find the estimated number of letters a state would have if it entered the Union in 1940. Does it appear that a line is the best way to fit the data? Why or why not? Use the least-squares line to estimate the number of letters a new state that enters the Union this year would have. Can the least squares line be used to predict it? Why or why not? Year is the independent or x variable; the number of letters is the dependent or y variable. Check student’s solution. no ŷ = 47.03 – 0.0216 x –0.4280 The r-value indicates that there is not a significant correlation between the year the state entered the union and the number of letters in the name. No, the relationship does not appear to be linear; the correlation is not significant.

Math