Formula that will give the equation for the line of best fit of a data set

Click For Summary
SUMMARY

The discussion focuses on generating the equation for a 6th degree polynomial line of best fit for a dataset using Excel. Users can utilize the Trendline feature by creating a Scatter Chart, adding a Trendline, selecting "Polynomial," and setting the order to 6. While Excel does not automatically link the polynomial coefficients to spreadsheet cells, users can manually input these coefficients and use the POWER() function for further calculations. Alternatives like MATLAB are suggested for more complex data analysis.

PREREQUISITES
  • Understanding of Excel charting features, specifically Scatter Charts and Trendlines
  • Familiarity with polynomial equations and their coefficients
  • Basic knowledge of Excel functions, particularly POWER()
  • Awareness of data analysis tools, including MATLAB for advanced analysis
NEXT STEPS
  • Learn how to create and manipulate Scatter Charts in Excel
  • Research methods to extract polynomial coefficients from Excel Trendlines
  • Explore MATLAB for advanced polynomial regression analysis
  • Study the use of Excel functions for mathematical modeling, including the use of POWER() and other operators
USEFUL FOR

Data analysts, Excel users, and anyone interested in statistical modeling and polynomial regression techniques.

tburke2
Messages
5
Reaction score
0
Is there a formula that will give me the equation for the line of best fit of a data set, the line being a 6th degree polynomial? I know how to graph the table and add a line of best fit while showing the equation but as far as I know the equation cannot be used in the given format in excel. If there was a way to refer back to the equation for further calculations that would work as well. Would it be easier to use a different program such as Matlab for in-dept data analysis? Thanks.
 
Physics news on Phys.org
Hello tburke2,

Welcome to Physics Forums! :smile:

tburke2 said:
Is there a formula that will give me the equation for the line of best fit of a data set, the line being a 6th degree polynomial? I know how to graph the table and add a line of best fit while showing the equation but as far as I know the equation cannot be used in the given format in excel. If there was a way to refer back to the equation for further calculations that would work as well. Would it be easier to use a different program such as Matlab for in-dept data analysis? Thanks.

You might have luck with the Trendline, if that suits your needs.

  • Start by inserting a chart/plot. It could be a Line chart if you are comfortable with your x-axis being the natural numbers. But you'll likely want to create a Scatter Chart instead, so you have control of the x-axis.
  • Once the chart is made, left-click on any point. Now all points are highlighted.
  • Now right click on a point, and a menu appears.
  • Click "Add Trendline..." from the menu's options.
  • Now off to the right, a new menu appears, "Format Trendline."
  • Click the "Polynomial" in the radio-button choices.
  • Select '6' in the "Order" menu (either type it in, or hit the up arrow repeatedly, until it displays '6').
  • Click the checkbox that says "Display Equation on chart"

If you need to change any of the data, simply modify the original data and the equation will change accordingly.

On the other hand, if you need to add all new data points it might mean that you must re-select your data. So when originally selecting your data for the x- and y- axis, you might wish to select some unused elements for future data points.
 
Oh, wait. I think I understand what you would like to do.

You want to automatically grab the coefficients of the polynomial and insert those into cells in the spreadsheet for future use. Is that right? I'm not sure if that can be done automatically. If it can be done, I'm not sure how. [Edit: Directly, -- taken directly from the chart -- that is. See next post on how you might re-create the coefficients.]

But if you put the coefficients into cells manually, you can then use those to create a formula. You might find the built-in POWER() function useful along with the '+' and '*' operators.

Of course, if you ever change your original data (used to create the polynomial) you'll have to change the resulting coefficients manually in your spreadsheet. Again, I'm not sure how to link cells with the Trendline polynomial coefficients to spreadsheet cells automatically (if it can be done at all).
 
Last edited:
Oh, and something like this might help to re-create the coefficients.
http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K