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 on the right, then dive deeper with the resources below.
Getting Started
To get started with regressions, you can follow a Regressions Tour in the help menu in the upper right of the calculator.
Regressions from a Table
To get started, 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.
Use the Zoom Fit icon in the bottom left of the expression line to automatically adjust the graph settings to best display your data.
To create a regression, click the Add Regression icon to the left of your expression, or open the options menu next to your y variable. This will automatically add a Linear Regression below your table.
From the model, you can explore the statistics, the correlation coefficient r (for linear regressions) or coefficient of determination R^2 (for nonlinear regressions), and plot the residuals (the vertical distance between your data points and the model).
Once the residuals are plotted, you can use the Zoom Fit icon to adjust the graph to best display your residuals.
To explore, press and hold the colored circle in the table to open the Options Menu and make your points draggable. This allows you to see how changing their values affects the regression model.
You can also copy a snapshot to the expression list. Once the snapshot is in the expression list, you can define it as a function, plug in different variables, and test predictions based on your model.
Note: Table regressions are only available in the Graphing Calculator and Geometry Tool.
Custom Regression Models
Table regressions only model curves from a set list of options. To use your own model, try creating a custom regression directly in an expression line.
Once you have data in a table, you can create a custom regression model in a new line by using the tilde symbol (~) in place of the equals sign (\(=\)). 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\), enter the expression \(y_1\) ~ \(ax_1^2\) to find the parameter a that best fits your data.
Note that the ~ symbol is usually to the left of the \(1\) on most keyboards or in the bottom row of the ABC part of the Desmos keypad.
You can also experiment with models that are not listed in the dropdown menu, such as a sinusoidal model. For example, you can enter \(y_1\) ~ \(a\) \(sin(bx_1+c)+d\) to fit a sine wave to your data. This will find the parameters \(a\), \(b\), \(c\), and \(d\) that best match the sinusoidal pattern in your data.
Once you’ve performed a regression, the parameter values are stored to their respective variables, allowing you to use them in other calculations. For example, after performing the sinusoidal regression above, try defining a new function, \(f(x) = a\) \(sin(bx+c)+d\), using the values of \(a\), \(b\), \(c\), and \(d\). You can then test values, such as \(f(0)\), to find the y-intercept.
To get more information about how Desmos does non-linear regressions and for some tips on how to best 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.