Regressions

Creating a regression in the Desmos Graphing Calculator, Geometry Tool, and 3D Calculator allows you to find a mathematical expression (like a line or a curve) to model the relationship between two sets of data. Get started with the video, then read on to learn more.

 

Getting Started

For an overview of regressions, open the Help menu Help Icon and then click the Regressions tour.

After exploring, you can try creating your own regression. You can use regression templates in the Graphing Calculator and Geometry Tool to create a curve from a set list of options.

Or, create a custom regression to use your own model.

Screenshot of Graphing Calculator with the Help Menu open and tours highlighted.

Regression Templates

Screenshot of Graphing Calculator with the Help Menu open and tours highlighted.

To create a regression, you’ll need to add data to a table. You can either create a table and enter the data manually or copy data from a spreadsheet and paste it into a blank expression line.

Click Zoom Fit Zoom Fit Icon to adjust the graph settings to best display your data automatically.

GIF using the Add Regression icon in the expression list and the Add Regression button in the options menu next to the y variable for a table of data.

Then, click Add RegressionAdd Regression Icon in your expression line. Or, open the Options menu Options Icon in your table. This will automatically add a linear regression to the same expression line.

Animation shown in the Graphing Calculator with 3 columns of data (x1, y1, and y2). A regression is added with a dropdown menu open to choose between a regression for y1 or y2.

Click Linear Regression to open the dropdown menu and explore which regression model best fits your data.

If you have multiple columns of data for the same independent variable, you will also see a dropdown to choose which column you’d like to use in your model.

Screenshot of graphing calculator showing a linear regression with plotted residuals.

Once you pick your model, you can explore its statistics; correlation coefficient \(r\) (for linear regressions) or coefficient of determination \(R^2\)(for nonlinear regressions); and residuals (the vertical distance between your data points and the model).

Click Plot to graph the residuals. You can then click Zoom Fit to adjust the graph to best display your residuals.

GIF turning on draggable points for a table with a Quadratic Regression. As the points are moved, the regression model updates. Then, the regression model is exported, converted from y= to f(x)=, and test the value f(0).

You can make your points draggable to see how changing their values affects the regression model. To do so, open the Options menu and toggle on Drag.

You can also click Export to the Expression ListExport to Expression List Icon to place the equation in a separate expression line. You can then define it as a function, plug in different variables, and test predictions based on your model.

GIF exporting a quadratic regression model to the expression list.

The different regression templates allow you to model curves to best fit your graph from a built in list of options. To edit one of the regression models, click Regression OptionsRegression Options Icon and then Export as Custom Regression. Or, create a standalone regression model directly in an expression line.

Custom Regression Models

To create a custom regression, start by adding your data to a table.

Then, in a new line, write an equation for your model and replace the equals sign (\(=\)) with a tilde \(~\). Use your table's column names (e.g., \(x_1\) and \(y_1\)) to reference the data in your model.

For example, if your quadratic model should follow the form \(y=ax^2+c\), enter the expression \(y_1\) ~ \(ax_1^2+c\) to find the parameters \(a\) and \(c\) that best fit your data.

Note that the tilde is usually to the left of the 1 on most keyboards or in the bottom row of the ABC part of the Desmos keypad.

Screenshot of a table of data with the custom regression y1~ax1^2+c.

Once you’ve performed a regression, the parameter values are stored to their respective variables, so you can use them in other calculations. For example, after performing the quadratic regression, you can try defining a new function, \(f(x)=ax^2+c\) using the values of \(a\) and \(c\). You can then test values, such as \(f(0)\), to find the \(y\)-intercept.

Screenshot of a regression to find parameters a an c and then using these parameters in an equation f(x) followed by evaluating f(0).

For information about how Desmos tools perform non-linear regressions and some tips on how to find a regression model, see our article on Non-Linear Regressions.

 

Learn More

Please write in with any questions or feedback to support@desmos.com.