ThisCalculator

Everyday

Regression on Graphing Calculator? How To

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

To perform regression on a graphing calculator, you enter your data into the stat lists, create a scatter plot, then use the built-in regression menu (usually under STAT > CALC) to compute the equation of the best-fit curve. This article explains the exact steps for linear, quadratic, and exponential regression on popular graphing calculators, how to interpret the output, and common pitfalls to avoid.

Formula

For linear regression, the calculator finds the line of best fit: y = a·x + b. The slope a and intercept b are calculated using the least-squares method, which minimizes the sum of the squared vertical distances between the data points and the line. The formulas are:

  • Slope: a = [n·Σ(xy) − Σx·Σy] / [n·Σ(x²) − (Σx)²]
  • Intercept: b = [Σy − a·Σx] / n
  • Correlation coefficient: r = [n·Σ(xy) − Σx·Σy] / √[(n·Σ(x²) − (Σx)²)(n·Σ(y²) − (Σy)²)]

Here, n is the number of data points, Σ denotes summation over all points, x and y are the coordinates of each point. The correlation coefficient r ranges from −1 to 1 and indicates the strength and direction of the linear relationship.

Worked Example

Using the default values from the calculator above: x = {1, 2, 3} and y = {2, 3, 5}.

  1. Compute sums: Σx = 1+2+3 = 6, Σy = 2+3+5 = 10, Σ(xy) = 1·2+2·3+3·5 = 2+6+15 = 23, Σ(x²) = 1+4+9 = 14, Σ(y²) = 4+9+25 = 38.
  2. Slope: a = (3·23 − 6·10) / (3·14 − 6²) = (69 − 60) / (42 − 36) = 9/6 = 1.5.
  3. Intercept: b = (10 − 1.5·6) / 3 = (10 − 9) / 3 = 1/3 ≈ 0.3333.
  4. Correlation: r = (3·23 − 6·10) / √[(3·14 − 36)(3·38 − 100)] = 9 / √[(42−36)(114−100)] = 9 / √(6·14) = 9 / √84 ≈ 0.98198.

The calculator shows a ≈ 1.5, b ≈ 0.3333, r ≈ 0.982. The line of best fit is y = 1.5x + 0.3333.

How to Enter Data

Before running a regression, you must input your data into the calculator’s statistical lists. On most TI graphing calculators (TI-84, TI-83, TI-Nspire), press STAT and select Edit to open the list editor. Enter your x-values in L1 and y-values in L2. If you have more than one data set, you can use L3, L4, etc. Make sure each list has the same number of entries; otherwise, the calculator will give an error.

For Casio graphing calculators (like the fx-9750GII), press MENU, select Statistics, and enter data into List 1 and List 2. The process is similar: fill the lists, then access the regression menu.

Performing the Regression

Once data is entered, follow these steps:

  • Create a scatter plot (optional but helpful): Press 2nd then Y= (STAT PLOT), turn on Plot1, choose the scatter plot icon, set Xlist to L1 and Ylist to L2, then press ZOOM and select ZoomStat to see the points.
  • Run the regression: Press STAT, scroll right to CALC. Choose the type: LinReg(ax+b) for linear, QuadReg for quadratic, CubicReg for cubic, ExpReg for exponential, LnReg for logarithmic, or PowerReg for power. Select the one that matches your data pattern.
  • Specify lists: After selecting, you may need to enter L1, L2 (or the lists you used). On TI-84, you can also set the frequency list to 1 and store the equation to Y1 if you want to graph it.
  • Calculate: Press ENTER to execute. The calculator displays the coefficients (a, b, c for quadratic) and the correlation coefficient r (for linear and some other models) and r² (coefficient of determination).

Interpreting the Output

The output shows the equation of the best-fit curve. For linear regression, you get a (slope) and b (y-intercept). For quadratic, you get a, b, c for y = ax² + bx + c. The r² value tells you how well the model fits the data: 1 means a perfect fit, 0 means no fit. r is the correlation coefficient, but it only applies to linear and some other models; for quadratic, r is not given (only r²). A high r² (close to 1) indicates the model explains most of the variability in y.

You can use the equation to predict y values for new x values. For example, if the line is y = 1.5x + 0.333, then for x = 10, y = 15.333. On the calculator, you can store the equation in Y1 and use the table or trace function to evaluate.

Common Mistakes and Troubleshooting

  • Mismatched lists: If L1 has 5 entries and L2 has 4, you get an error. Ensure all lists have equal length.
  • Wrong regression type: Using linear on curved data will give a poor fit. Look at the scatter plot first to decide if the relationship is linear, quadratic, exponential, etc.
  • Forgetting to clear old data: Old data in lists can interfere. Clear lists with STAT > Edit and highlight the list name, then press CLEAR.
  • Diagnostics off: On TI-84, if r and r² don’t appear, go to 2nd > CATALOG and turn on DiagnosticOn.
  • Rounding errors: The calculator stores full precision, but if you manually round coefficients, predictions may be off. Use the stored equation for calculations.

Alternatives and Advanced Models

Graphing calculators offer multiple regression models. Linear is for straight-line trends. Quadratic (y = ax² + bx + c) fits data with one bend. Cubic fits data with two bends. Exponential (y = ab^x) fits data that grows or decays at a constant percentage rate. Logarithmic (y = a + b·ln x) fits data that increases rapidly then levels off. Power (y = a·x^b) fits data where both variables are transformed by powers.

For more complex regression, you can use computer software like spreadsheet programs or statistical packages, but the calculator is sufficient for most educational and basic scientific needs. Also, you can perform multiple linear regression (with several independent variables) on some calculators, but that is less common and usually requires a computer.

Frequently Asked Questions

How do I get r and r² on my TI-84? Press 2nd then 0 (CATALOG), scroll to DiagnosticOn and press ENTER twice. Then rerun the regression; r and r² will appear.

What does r² mean? r² is the coefficient of determination. It represents the proportion of the variance in y that is explained by the regression model. For example, r² = 0.9 means 90% of the variation in y is explained by x.

Can I do regression on a Casio calculator? Yes. Enter data in List 1 and List 2, then go to the STAT menu, choose CALC, and select the regression type. The process is similar to TI calculators.

Why does my calculator give a different equation than my friend’s? Different calculators may use different algorithms or rounding, but the differences are usually tiny. If you use the same data and same regression type, results should match to several decimal places.

How do I predict a y value from the regression equation? Once you have the equation, you can either store it in Y1 and use the table (2nd GRAPH) or evaluate at a specific x using the home screen: type the equation with x replaced by your value, or use the Y-VARS menu to recall Y1 and plug in x.

What if my data is not linear? Look at the scatter plot. If the points curve, try quadratic or exponential. You can compare r² values from different models; the one with the highest r² (closest to 1) is usually the best fit.

Related

Formula used
in x | x values | - | 1 | 0
in y | y values | - | 2 | 0
out a | Slope (a) | - | (count(x)*sum(x*y)-sum(x)*sum(y))/(count(x)*sum(x^2)-sum(x)^2) | 4
out b | Intercept (b) | - | (sum(y)-a*sum(x))/count(x) | 4
out r | Correlation (r) | - | (count(x)*sum(x*y)-sum(x)*sum(y))/sqrt((count(x)*sum(x^2)-sum(x)^2)*(count(x)*sum(y^2)-sum(y)^2)) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.