Chapter 10: Linear Regression and Correlation
10.7 Using Technology for Linear Regression
Learning Objectives
By the end of this section, the student should be able to:
- use technology to solve problems involving Linear Regression
This is another section to show technology tools that can be used to help with the statistics concepts taught in this chapter. This section will cover tools to help solve problems involving Linear Regression.
Graphing Calculator
Similar to all the other technology sections, the main tool introduced will be the TI-83, 83+, 84, or 84+ Graphing Calculator. The graphing calculator can help to do A LOT of the concepts of Linear Regression, including:
- drawing a scatter plot
- finding the least-squares regression line or best-fit line
- finding the correlation coefficient [latex]r[/latex] and coefficient of determination [latex]r^{2}[/latex]
- hypothesis testing to check the significance of the correlation coefficient [latex]r[/latex]
- checking for outliers
Let's see how to do each of these with directions and an example.
Create a Scatter Plot
In 10.2 Scatter Plots we saw how to display the relation between two variables [latex]x[/latex] and [latex]y[/latex] by using scatter plots. Let's see the directions for doing in in the calculator. Try it with this example:
Example
In Europe and Asia, m-commerce is popular. M-commerce users have special mobile phones that work like electronic wallets as well as provide phone and Internet services. Users can do everything from paying for parking to buying a TV set or soda from a machine to banking to checking sports scores on the Internet. For the years 2000 through 2004, was there a relationship between the year and the number of m-commerce users? Construct a scatter plot. Let [latex]x = \text{the year}[/latex], and let [latex]y = \text{the number of m-commerce users, in millions}[/latex].
| [latex]x[/latex] (year) | [latex]y[/latex] (# of users) |
|---|---|
| 2000 | 0.5 |
| 2002 | 20.0 |
| 2003 | 33.0 |
| 2004 | 47.0 |

Using the TI-83, 83+, 84, 84+ Calculator
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.
Least-Squares Regression Line or Best-Fit Line
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 below. But another option using the graphing calculator is also beneficial for all things linear regression. It is the LinRegTTest.
Using the TI-83, 83+, 84, 84+ Calculator
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.
Try it with this example from 10.3 The Regression Equation:
Example
A random sample of 11 statistics students produced the following data, where [latex]x[/latex] is the third exam score out of 80, and [latex]y[/latex] 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?
| [latex]x[/latex] (third exam score) | [latex]y[/latex] (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 |
If you run the LinRegTTest you will see the following screens in Figure 2.
The left image is the calculator input screen for the LinRegTTest with input matching the instructions above.
The right image is the calculator output screen for the LinRegTTest. The output screen shows: LinRegTTest; y = a + bx; Beta does not equal 0 and rho does not equal 0; t = 2.657560155; df = 9; a = 173.513363; b = 4.827394209; s = 16.41237711; r squared = .4396931104; r = .663093591

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 [latex]y = a + bx[/latex]. Scroll down to find the values [latex]a = –173.513[/latex], and [latex]b = 4.8273[/latex]; the equation of the best fit line is [latex]\hat{y} = –173.51 + 4.83x[/latex].
The two items at the bottom are [latex]r^{2} = 0.43969[/latex] and [latex]r = 0.663[/latex]. For now, just note where to find these values; we will discuss them in the next two sections.
Once you have a scatter plot and a regression line, you can graph them both in the graphing calculator.
Using the TI-83, 83+, 84, 84+ Calculator
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
In 10.3 The Regression Equation we saw how to calculate the correlation coefficient, r, which is the numerical value that provides a measure of strength and direction of the linear association between the independent variable x and the dependent variable y. 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 heading for instructions).
The Coefficient of Determination
The variable r2 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. The coefficient of determination is the bottom item in the output screens for the LinRegTTest on the TI-83, TI-83+, or TI-84+ calculator (see previous heading for instructions).
Hypothesis Testing for the Significance of the Correlation Coefficient
We covered in 10.4 Testing the Significance of the Correlation Coefficient that we can 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. As a reminder, this was the background information from the section:
The sample data are used to compute [latex]r[/latex], the correlation coefficient for the sample. If we had data for the entire population, we could find the population correlation coefficient. But because we only have sample data, we cannot calculate the population correlation coefficient.
The sample correlation coefficient, [latex]r[/latex], is our estimate of the unknown population correlation coefficient.
- The symbol for the population correlation coefficient is [latex]\rho[/latex], the Greek letter "rho."
- [latex]\rho =[/latex] population correlation coefficient (unknown)
- [latex]r =[/latex] sample correlation coefficient (known; calculated from sample data)
The hypothesis test lets us decide whether the value of the population correlation coefficient [latex]\rho[/latex] is "close to zero" or "significantly different from zero". We decide this based on the sample correlation coefficient [latex]r[/latex] and the sample size [latex]n[/latex].
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 [latex]x[/latex] and [latex]y[/latex] because the correlation coefficient is significantly different from zero.
- What the conclusion means: There is a significant linear relationship between [latex]x[/latex] and [latex]y[/latex]. We can use the regression line to model the linear relationship between [latex]x[/latex] and [latex]y[/latex] 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 [latex]x[/latex] and [latex]y[/latex] because the correlation coefficient is not significantly different from zero."
- What the conclusion means: There is not a significant linear relationship between [latex]x[/latex] and [latex]y[/latex]. Therefore, we CANNOT use the regression line to model a linear relationship between [latex]x[/latex] and [latex]y[/latex] in the population.
To actually perform the hypothesis test,
- Null Hypothesis: [latex]H_0: \rho = 0[/latex]
- Alternate Hypothesis: [latex]H_a: \rho \neq 0[/latex]
What the hypotheses mean in words:
- Null Hypothesis [latex]H_0[/latex]: 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 [latex]H_a[/latex]: The population correlation coefficient IS significantly DIFFERENT FROM zero. There IS A SIGNIFICANT LINEAR RELATIONSHIP (correlation) between x and y in the population.
We saw 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
The TI-83, 83+, 84, 84+ calculator function LinRegTTest can perform this hypothesis test using Method 1.
Method 1: Using a p-value to make a decision
Using the TI-83, 83+, 84, 84+ Calculator
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.)
- 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."
- 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."
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.
Example
A random sample of 11 statistics students produced the following data, where [latex]x[/latex] is the third exam score out of 80, and [latex]y[/latex] 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? Table below shows the scores on the final exam based on scores from the third exam.
| [latex]x[/latex] (third exam score) | [latex]y[/latex] (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 |
We found that the line of best fit is: [latex]\hat{y} = -173.51 + 4.83x[/latex] with [latex]r = 0.6631[/latex] and there are [latex]n = 11[/latex] data points. Can the regression line be used for prediction? Given a third exam score ([latex]x[/latex] value), can we use the line to predict the final exam score (predicted [latex]y[/latex] value)?
[latex]H_0: \rho = 0[/latex]
[latex]H_a: \rho \neq 0[/latex]
[latex]\alpha = 0.05[/latex]
- 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 [latex]\alpha = 0.05[/latex].
Decision: Reject the Null Hypothesis [latex]H_0[/latex]
Conclusion: There is sufficient evidence to conclude that there is a significant linear relationship between the third exam score ([latex]x[/latex]) and the final exam score ([latex]y[/latex]) because the correlation coefficient is significantly different from zero.
Because [latex]r[/latex] is significant and the scatter plot shows a linear trend, the regression line can be used to predict final exam scores.
Outliers
In 10.6 Outliers, we discussed in some data sets, there are values (observed data points) called outliers. Outliers are observed data points that are far from the least squares line. They have large "errors", where the "error" or residual is the vertical distance from the line to the point. Outliers need to be examined closely. Sometimes, for some reason or another, they should not be included in the analysis of the data. It is possible that an outlier is a result of erroneous data. Other times, an outlier may hold valuable information about the population under study and should remain included in the data. The key is to examine carefully what causes a data point to be an outlier.
Computers and many calculators can be used to identify outliers from the data. Computer output for regression analysis will often identify both outliers and influential points so that you can examine them.
We could guess at outliers by looking at a graph of the scatterplot and best fit-line. However, we would like some guideline as to how far away a point needs to be in order to be considered an outlier. As a rough rule of thumb, we can flag any point that is located further than two standard deviations above or below the best-fit line as an outlier. The standard deviation used is the standard deviation of the residuals or errors.
We can do this visually in the scatter plot by drawing an extra pair of lines that are two standard deviations above and below the best-fit line. Any data points that are outside this extra pair of lines are flagged as potential outliers. Or we can do this numerically by calculating each residual and comparing it to twice the standard deviation. On the TI-83, 83+, or 84+, the graphical approach is easier. The graphical procedure is shown first, followed by the numerical calculations. You would generally need to use only one of these methods.
Let's see this with the same example from earlier.
Example
A random sample of 11 statistics students produced the following data, where [latex]x[/latex] is the third exam score out of 80, and [latex]y[/latex] 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? Table below shows the scores on the final exam based on scores from the third exam.
| [latex]x[/latex] (third exam score) | [latex]y[/latex] (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 |
You can determine if there is an outlier or not. If there is an outlier, as an exercise, delete it and fit the remaining data to a new line. For this example, the new line ought to fit the remaining data better. This means the SSE should be smaller and the correlation coefficient ought to be closer to 1 or –1.
Graphical Identification of Outliers:
With the TI-83, 83+, 84+ graphing calculators, it is easy to identify the outliers graphically and visually. If we were to measure the vertical distance from any data point to the corresponding point on the line of best fit and that distance were equal to [latex]2s[/latex] or more, then we would consider the data point to be "too far" from the line of best fit. We need to find and graph the lines that are two standard deviations below and above the regression line. Any points that are outside these two lines are outliers. We will call these lines [latex]Y2[/latex] and [latex]Y3[/latex].
As we did with the equation of the regression line and the correlation coefficient, we will use technology to calculate this standard deviation for us. Using the LinRegTTest with this data, scroll down through the output screens to find [latex]s = 16.412[/latex].
Line [latex]Y2 = –173.5 + 4.83x –2(16.4)[/latex] and line [latex]Y3 = –173.5 + 4.83x + 2(16.4)[/latex] where [latex]\hat{y} = –173.5 + 4.83x[/latex] is the line of best fit. [latex]Y2[/latex] and [latex]Y3[/latex] have the same slope as the line of best fit.
Graph the scatter plot with the best fit line in equation Y1, then enter the two extra lines as [latex]Y2[/latex] and [latex]Y3[/latex] in the "Y=" equation editor and press ZOOM 9. You will find that the only data point that is not between lines [latex]Y2[/latex] and [latex]Y3[/latex] is the point [latex]x = 65[/latex], [latex]y = 175[/latex]. On the calculator screen, it is just barely outside these lines. The outlier is the student who had a grade of 65 on the third exam and 175 on the final exam; this point is farther than two standard deviations away from the best-fit line.
Sometimes a point is so close to the lines used to flag outliers on the graph that it is difficult to tell if the point is between or outside the lines. On a computer, enlarging the graph may help; on a small calculator screen, zooming in may make the graph clearer. Note that when the graph does not give a clear enough picture, you can use the numerical comparisons to identify outliers.

If you do want to use the numerical approach, you can still use the graphing calculator to assist you. Rather than calculate the value of [latex]s[/latex] for the residuals ourselves, we can find s using the calculator. For this example, the calculator function LinRegTTest found [latex]s = 16.4[/latex] as the standard deviation of the residuals 35; –17; 16; –6; –19; 9; 3; –1; –10; –9; –1.
| [latex]x[/latex] | [latex]y[/latex] | [latex]\hat{y}[/latex] | [latex]y – \hat{y}[/latex] |
|---|---|---|---|
| 65 | 175 | 140 | 175 – 140 = 35 |
| 67 | 133 | 150 | 133 – 150= –17 |
| 71 | 185 | 169 | 185 – 169 = 16 |
| 71 | 163 | 169 | 163 – 169 = –6 |
| 66 | 126 | 145 | 126 – 145 = –19 |
| 75 | 198 | 189 | 198 – 189 = 9 |
| 67 | 153 | 150 | 153 – 150 = 3 |
| 70 | 163 | 164 | 163 – 164 = –1 |
| 71 | 159 | 169 | 159 – 169 = –10 |
| 69 | 151 | 160 | 151 – 160 = –9 |
| 69 | 159 | 160 | 159 – 160 = –1 |
We are looking for all data points for which the residual is greater than [latex]2s = 2(16.4) = 32.8[/latex] or less than –32.8. Compare these values to the residuals in column four of the table. The only such data point is the student who had a grade of 65 on the third exam and 175 on the final exam; the residual for this student is 35.
How Does the Outlier Affect the Best Fit Line?
For the example above, numerically and graphically, we have identified the point (65, 175) as an outlier. We should re-examine the data for this point to see if there are any problems with the data. If there is an error, we should fix the error if possible, or delete the data. If the data is correct, we would leave it in the data set. For this problem, we will suppose that we examined the data and found that this outlier data was an error. Therefore we will continue on and delete the outlier, so that we can explore how it affects the results, as a learning experience.Compute a new best-fit line and correlation coefficient using the ten remaining points:
On the TI-83, TI-83+, TI-84+ calculators, delete the outlier from L1 and L2. Using the LinRegTTest, the new line of best fit and the correlation coefficient are [latex]\hat{y} = –355.19 + 7.39x[/latex] and [latex]r = 0.9121[/latex].
The new line with [latex]r = 0.9121[/latex] is a stronger correlation than the original ([latex]r = 0.6631[/latex]) because [latex]r = 0.9121[/latex] is closer to one. This means that the new line is a better fit to the ten remaining data values. The line can better predict the final exam score given the third exam score.
Here's a new example for you to try everything that was shown that you can do on the graphing calculator.
Example
The Consumer Price Index (CPI) measures the average change over time in the prices paid by urban consumers for consumer goods and services. The CPI affects nearly all Americans because of the many ways it is used. One of its biggest uses is as a measure of inflation. By providing information about price changes in the Nation's economy to government, business, and labor, the CPI helps them to make economic decisions. The president, Congress, and the Federal Reserve Board use the CPI's trends to formulate monetary and fiscal policies. In the following table, x is the year and y is the CPI.
| [latex]x[/latex] | [latex]y[/latex] | [latex]x[/latex] | [latex]y[/latex] |
|---|---|---|---|
| 1915 | 10.1 | 1969 | 36.7 |
| 1926 | 17.7 | 1975 | 49.3 |
| 1935 | 13.7 | 1979 | 72.6 |
| 1940 | 14.7 | 1980 | 82.4 |
| 1947 | 24.1 | 1986 | 109.6 |
| 1952 | 26.5 | 1991 | 130.7 |
| 1964 | 31.0 | 1999 | 166.6 |
- Draw a scatter plot of the data.
- Calculate the least squares line. Write the equation in the form [latex]\hat{y} = a + bx[/latex].
- Draw the line on the scatter plot.
- Find the correlation coefficient.
- Is the correlation coefficient significant?
- Are there any outliers in the data?
Solution
- Shown below with question 3.
- [latex]\hat{y} = –3204 + 1.662x[/latex] is the equation of the line of best fit.
-

Figure 4. Scatter Plot for Example - [latex]r = 0.8694[/latex]
- [latex]r[/latex] is significant
- Using the calculator LinRegTTest, we find that [latex]s = 25.4[/latex]; graphing the lines [latex]Y2 = –3204 + 1.662X – 2(25.4)[/latex] and [latex]Y3 = –3204 + 1.662X + 2(25.4)[/latex] shows that no data values are outside those lines, identifying no outliers. (Note that the year 1999 was very close to the upper line, but still inside it.)
More Notes for Graphing Calculator
As we have seen on this page, the TI-83 has a built-in linear regression feature, which allows the data to be inputted and run to calculate everything needed. To use the calculator, the x-values will be in [L1]; the y-values in [L2]. Here's some more detailed notes for using the graphing calculator for concepts covered on this page. Also some alternate steps than what was already mentioned.
To enter data and do linear regression:
-
Turns calculator on. -
Before accessing this program, be sure to turn off all plots.
-
Access graphing mode.
, [STAT PLOT] -
Turn off all plots.
, 
-
- Round to three decimal places. To do so:
-
Access the mode menu.
, [STAT PLOT] -
Navigate to
<Float>and then to the right to<3>.

-
All numbers will be rounded to three decimal places until changed.

-
-
Enter statistics mode and clear lists
[L1]and[L2], as describe previously.
, 
-
Enter editing mode to insert values for x and y.
, 
- Enter each value. Press
to continue.
To display the correlation coefficient:
-
Access the catalog.
, [CATALOG] -
Arrow down and select
<DiagnosticOn>
... ,
, 
- \(r\) and \({r}^{2}\) will be displayed during regression calculations.
-
Access linear regression.

-
Select the form of y = a + bx.
, 
To see the scatter plot:
-
Access graphing mode.
, [STAT PLOT] -
Select
<1:plot 1>To access plotting - first graph.

-
Navigate and select
<ON>to turn on Plot 1.
<ON>
- Navigate to the first picture.
-
Select the scatter plot.

- Navigate to
<Xlist>. - If
[L1]is not selected, press
, [L1]to select it. -
Confirm that the data values are in
[L1].
<ON>
- Navigate to
<Ylist>. -
Select that the frequencies are in
[L2].
, [L2],
-
Go back to access other graphs.
, [STAT PLOT] - Use the arrows to turn off the remaining plots.
- Access window mode to set the graph parameters.

- Be sure to deselect or clear all equations before graphing, using the instructions above.
- Press the graph button to see the scatter plot.

To see the regression graph:
-
Access the equation menu. The regression equation will be put into Y1.

-
Access the vars menu and navigate to
<5: Statistics>.
, 
- Navigate to
<EQ>. -
<1: RegEQ>contains the regression equation which will be entered in Y1.

- Press the graphing mode button. The regression line will be superimposed over the scatter plot.

To see the residuals and use them to calculate the critical point for an outlier:
-
Access the list. RESID will be an item on the menu. Navigate to it.
, [LIST],<RESID> -
Confirm twice to view the list of residuals. Use the arrows to select them.
, 
- The critical point for an outlier is: \(1.9V\frac{\mathrm{SSE}}{n-2}\) where:
- \(n\) = number of pairs of data
- \(\mathrm{SSE}\) = sum of the squared errors
- \(\sum _{}^{}{\mathrm{residual}}^{2}\)
-
Store the residuals in
[L3].
,
, [L3],
-
Calculate the [latex]\frac{{\mathrm{\left(residual\right)}}^{2}}{n-2}\).
, [L3],
,
, 
-
Store this value in
[L4].
,
, [L4],
-
Calculate the critical value using the equation above.
,
,
,
,
, [V],
, [LIST]
,
,
,
, [L4],
,
, 
- Compare the absolute value of each residual value in
[L3]to the critical value. If the absolute value is greater than the critical value, then the (x, y) corresponding point is an outlier. In this case, none of the points is an outlier.
To obtain estimates of y for various x-values:
There are various ways to determine estimates for "y." One way is to substitute values for "x" in the equation. Another way is to use the
on the graph of the regression line.
Legend
represents a button press[ ]represents yellow command or green letter behind a key< >represents items on the screen
Helpful Videos for the Graphing Calculator
Below are links to helpful videos for using the graphing calculator for the concepts covered on this page:
- Ex: Linear Regression Application on the TI84 - Supply and Demand
- Linear Regression on the TI84 Graphing Calculator
- Linear Regression Application on the TI-84
- TI-84: Linear Regression, r and r-squared
- TI-84: Linear Regression - Meaning of Slope and Vertical Intercept (Investment)
- Ex 1: Create a Scatter Plot and then Perform Linear Regression on the Calculator
- Ex 2: Creating a Scatter Plot and Performing Linear Regression on the Calculator
- Linear Regression on a TI-83 and TI-84
- t-Test for Slope of Regression Line for TI-83 & TI-84
- TI-84 - Regression Coefficient Confidence Interval
Additional Technology Tools
In addition to the graphing calculator, there are some additional technology tools that can be used for the concepts covered on this page. Below are links to helpful videos for those tools:
- Linear Regression on Desmos:
- Microsoft Excel:
- Linear Regression Made Easy! The Epic Full Story with all Details
- Linear Regression Trendline in Excel Charting
- Linear Regression #1: Scatter Diagram: Relationship Between 2 Variables?
- Linear Regression #2: Scatter Plot with Trendline & X and Y Mean Lines
- Linear Regression #3: Sample Covariance & Coefficient of Correlation
- Linear Regression #4: Calculate Slope, Y-Intercept, Estimated Equation
- Linear Regression #5: Coefficient of Determination: Goodness of Fit
Section Practice
| 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: [latex]\hat{y} = a + bx[/latex]
- 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.
Solution
-
Table 8: Midpoints for Table 7 Age Data Age Number of Driver Deaths per 100,000 17.5 38 22 36 29.5 24 44.5 20 64.5 18 80 28 - Check student’s solution.
- [latex]\hat{y} = 35.5818045 – 0.19182491x[/latex]
- [latex]r = –0.57874[/latex]. 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 [latex]r = –0.57874[/latex] is not less than –0.811, so we do not reject the null hypothesis.
- if age = 40, [latex]\hat{y} (\text{deaths}) = 35.5818045 - 0.19182491(40) = 27.9[/latex]
if age = 60, [latex]\hat{y} (\text{deaths}) = 35.5818045 - 0.19182491(60) = 24.1[/latex] - For the entire dataset, there is a linear relationship for the ages up to age 74. The oldest age group shows an increase in deaths from the prior group, which is not consistent with the younger ages.
- [latex]\text{slope} = –0.19182491[/latex]
The maximum discount value of the Entertainment® card for the “Fine Dining” section, Edition ten, for various pages is given in the table below.
| 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: [latex]\hat{y} = a + bx[/latex]
- 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.
Solution
- We wonder if the better discounts appear earlier in the book so we select page as [latex]X[/latex] and discount as [latex]Y[/latex].
- Check student’s solution.
- [latex]\hat{y} = 17.21757 – 0.01412x[/latex]
- [latex]r = – 0.2752[/latex]. For seven [latex]df[/latex] and [latex]\alpha = 0.05[/latex], using LinRegTTest [latex]\text{p-value} = 0.4736[/latex] so we do not reject; there is not a significant linear relationship between page and discount.Using the table of critical values for the correlation coefficient, with seven [latex]df[/latex], the critical value is 0.666. The correlation coefficient [latex]x_i = –0.2752[/latex] is not less than 0.666 so we do not reject.
- page 10: 17.08; page 70: 16.23
- There is not a significant linear correlation so it appears there is no relationship between the page and the amount of the discount.
- page 200: 14.39
- No, using the regression equation to predict for page 200 is extrapolation.
- [latex]\text{slope} = –0.01412[/latex]; As the page number increases by one page, the discount decreases by $0.01412.
Ornithologists, scientists who study birds, tag sparrow hawks in 13 different colonies to study their population. They gather data for the percent of new sparrow hawks in each colony and the percent of those that have returned from migration.
Percent return: 74; 66; 81; 52; 73; 62; 52; 45; 62; 46; 60; 46; 38
Percent new: 5; 6; 8; 11; 12; 15; 16; 17; 18; 18; 19; 20; 20
- Enter the data into your calculator and make a scatter plot.
- Use your calculator’s regression function to find the equation of the least-squares regression line. Add this to your scatter plot from part 1.
- Explain in words what the slope and y-intercept of the regression line tell us.
- How well does the regression line fit the data? Explain your response.
- Which point has the largest residual? Explain what the residual means in context. Is this point an outlier? An influential point? Explain.
- An ecologist wants to predict how many birds will join another colony of sparrow hawks to which 70% of the adults from the previous year have returned. What is the prediction?
Solution
- Check student's solution.
- Check student's solution
- The slope of the regression line is -0.3179 with a y-intercept of 32.966. In context, the y-intercept indicates that when there are no returning sparrow hawks, there will be almost 31% new sparrow hawks, which doesn’t make sense since if there are no returning birds, then the new percentage would have to be 100% (this is an example of why we do not extrapolate). The slope tells us that for each percentage increase in returning birds, the percentage of new birds in the colony decreases by 0.3179%.
- If we examine [latex]r^2[/latex], we see that only 50.238% of the variation in the percent of new birds is explained by the model and the correlation coefficient, [latex]r = 0.71[/latex] only indicates a somewhat strong correlation between returning and new percentages.
- The ordered pair (66, 6) generates the largest residual of 6.0. This means that when the observed return percentage is 66%, our observed new percentage, 6%, is almost 6% less than the predicted new value of 11.98%. If we remove this data pair, we see only an adjusted slope of -0.2723 and an adjusted intercept of 30.606. In other words, even though this data generates the largest residual, it is not an outlier, nor is the data pair an influential point.
- If there are 70% returning birds, we would expect to see [latex]y = -0.2723(70) + 30.606 = 0.115[/latex] or 11.5% new birds in the colony.
The following table (Table 10) shows data on average per capita wine consumption and heart disease rate in a random sample of 10 countries.
| Yearly wine consumption in liters | 2.5 | 3.9 | 2.9 | 2.4 | 2.9 | 0.8 | 9.1 | 2.7 | 0.8 | 0.7 |
|---|---|---|---|---|---|---|---|---|---|---|
| Death from heart diseases | 221 | 167 | 131 | 191 | 220 | 297 | 71 | 172 | 211 | 300 |
- Enter the data into your calculator and make a scatter plot.
- Use your calculator’s regression function to find the equation of the least-squares regression line. Add this to your scatter plot from part 1.
- Explain in words what the slope and y-intercept of the regression line tell us.
- How well does the regression line fit the data? Explain your response.
- Which point has the largest residual? Explain what the residual means in context. Is this point an outlier? An influential point? Explain.
- Do the data provide convincing evidence that there is a linear relationship between the amount of alcohol consumed and the heart disease death rate? Carry out an appropriate test at a significance level of 0.05 to help answer this question.
The following table (Table 11) consists of one student athlete’s time (in minutes) to swim 2000 yards and the student’s heart rate (beats per minute) after swimming on a random sample of 10 days:
| Swim Time | Heart Rate |
|---|---|
| 34.12 | 144 |
| 35.72 | 152 |
| 34.72 | 124 |
| 34.05 | 140 |
| 34.13 | 152 |
| 35.73 | 146 |
| 36.17 | 128 |
| 35.57 | 136 |
| 35.37 | 144 |
| 35.57 | 148 |
- Enter the data into your calculator and make a scatter plot.
- Use your calculator’s regression function to find the equation of the least-squares regression line. Add this to your scatter plot from part 1.
- Explain in words what the slope and y-intercept of the regression line tell us.
- How well does the regression line fit the data? Explain your response.
- Which point has the largest residual? Explain what the residual means in context. Is this point an outlier? An influential point? Explain.
Solution
- Check student’s solution.
- Check student’s solution.
- We have a slope of –1.4946 with a y-intercept of 193.88. The slope, in context, indicates that for each additional minute added to the swim time, the heart rate will decrease by 1.5 beats per minute. If the student is not swimming at all, the y-intercept indicates that his heart rate will be 193.88 beats per minute. While the slope has meaning (the longer it takes to swim 2,000 meters, the less effort the heart puts out), the y-intercept does not make sense. If the athlete is not swimming (resting), then his heart rate should be very low.
- Since only 1.5% of the heart rate variation is explained by this regression equation, we must conclude that this association is not explained with a linear relationship.
- The point (34.72, 124) generates the largest residual of –11.82. This means that our observed heart rate is almost 12 beats less than our predicted rate of 136 beats per minute. When this point is removed, the slope becomes 1.6914 with the y-intercept changing to 83.694. While the linear association is still very weak, we see that the removed data pair can be considered an influential point in the sense that the y-intercept becomes more meaningful.
A researcher is investigating whether non-white minorities commit a disproportionate number of homicides. He uses demographic data from Detroit, MI to compare homicide rates and the number of the population that are white males.
| White Males | Homicide rate per 100,000 people |
|---|---|
| 558,724 | 8.6 |
| 538,584 | 8.9 |
| 519,171 | 8.52 |
| 500,457 | 8.89 |
| 482,418 | 13.07 |
| 465,029 | 14.57 |
| 448,267 | 21.36 |
| 432,109 | 28.03 |
| 416,533 | 31.49 |
| 401,518 | 37.39 |
| 387,046 | 46.26 |
| 373,095 | 47.24 |
| 359,647 | 52.33 |
- Use your calculator to construct a scatter plot of the data. What should the independent variable be? Why?
- Use your calculator’s regression function to find the equation of the least-squares regression line. Add this to your scatter plot.
- Discuss what the following mean in context.
- The slope of the regression equation
- The y-intercept of the regression equation
- The correlation r
- The coefficient of determination r2.
- Do the data provide convincing evidence that there is a linear relationship between the number of white males in the population and the homicide rate? Carry out an appropriate test at a significance level of 0.05 to help answer this question.