Line of best fit
Enter the data Find \( \bar{x} \) and \( \bar{y} \) Calculate the line of best fit Graph the line of best fit with the data

Suppose you want to do a linear regression on the following table:

x y
29
5-6
8-7
15.5-28
16.2-15
14-20
12-15
13-20.3
2.59
14.1
0.56
-312.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.

Parameters Screenshot

Find \( \bar{x} \) and \( \bar{y} \)

  1. Press Menu Icon and select Statistics > Stat Calculations > Two-Variable Statistics. Fill the parameters as follows:

    Parameters Screenshot

  2. Press Enter Icon. 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

  1. Press Menu Icon and select Statistics > Stat Calculations > Linear Regression (\( ax + b \)).

    Choose the parameters as follows:

    Line of Best Fit Screenshot

  2. Press Enter Icon. The following result should appear:

    Line of Best Fit Screenshot

Graph the line of best fit with the data

  1. Press Menu Icon and select Add Data & Statistics.
  2. In the y-axis name, select stat.yreg. In the x-axis name, select stat.xreg.

    Line of Best Fit Screenshot

  3. 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 \).
  4. Press Menu Icon and select Analyze > Regression > Show Linear (\( ax+b \)). Press Enter Icon.

    Line of Best Fit Screenshot