Suppose you want to do a linear regression on the following table:
x
y
2
9
5
-6
8
-7
15.5
-28
16.2
-15
14
-20
12
-15
13
-20.3
2.5
9
1
4.1
0.5
6
-3
12.1
Enter the data
Create a new document and select Add Lists & Spreadsheet. Fill the list A with the x-values, and the list B with the y-values.
Find \( \bar{x} \) and \( \bar{y} \)
Press and select Statistics > Stat Calculations > Two-Variable Statistics. Fill the parameters as follows:
Press . The results are displayed in the table and should be \( \bar{x} = 7.23 \) and \( \bar{y} = -5.93 \).
Calculate the line of best fit
Press and select Statistics > Stat Calculations > Linear Regression (\( ax + b \)).
Choose the parameters as follows:
Press . The following result should appear:
Graph the line of best fit with the data
Press and select Add Data & Statistics.
In the y-axis name, select stat.yreg. In the x-axis name, select stat.xreg.
Choose an appropriate window to have all the points fit nicely on the screen. Here, we chose \( X_{\text{min}} = -5 \), \( X_{\text{max}} = 18 \), \( Y_{\text{min}} = -30 \), and \( Y_{\text{max}} = 15 \).
Press and select Analyze > Regression > Show Linear (\( ax+b \)). Press .