ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Polynomoal Regression (https://www.excelbanter.com/excel-programming/329431-polynomoal-regression.html)

Steve R

Polynomoal Regression
 
Is there a way to automatically insert the coefficients of a second order
polynomial regression based on three or four data points into prescribed
cells or must they be copied from the equation derived by adding a trendline
to an XY-chart? Thanks.

Peter T

Polynomoal Regression
 
=LINEST(yVals, xVals^{1,2})

array enter into a row of two cells, or three if you want the final constant

should give you the coefficients a, b & c in =a*x^2 + b*x + c

yVals & xVals being equal sized ranges which could be named

Regards,
Peter T


"Steve R" wrote in message
...
Is there a way to automatically insert the coefficients of a second order
polynomial regression based on three or four data points into prescribed
cells or must they be copied from the equation derived by adding a

trendline
to an XY-chart? Thanks.




Steve R

Polynomoal Regression
 
Thanks. Worked like a charm.

"Peter T" wrote:

=LINEST(yVals, xVals^{1,2})

array enter into a row of two cells, or three if you want the final constant

should give you the coefficients a, b & c in =a*x^2 + b*x + c

yVals & xVals being equal sized ranges which could be named

Regards,
Peter T


"Steve R" wrote in message
...
Is there a way to automatically insert the coefficients of a second order
polynomial regression based on three or four data points into prescribed
cells or must they be copied from the equation derived by adding a

trendline
to an XY-chart? Thanks.





Peter T

Polynomoal Regression
 
Glad it works.

You mentioned copying the equation from a trend line, and in some
circumstances that might be a better approach. There's a long thread here

http://tinyurl.com/a2ysv
Subject: "Extract formula from Text box"
Date: Feb 2005

leading to "total package" solutions to create a 3rd order polynomial
trendline, get the formula, parse it, use it, and return calculated result.
Also some caveats regarding the importance of using precision even if a
precise result is not required, and problems with Linest (in some scenarios
with older versions of Excel).

Regards,
Peter T

"Steve R" wrote in message
...
Thanks. Worked like a charm.

"Peter T" wrote:

=LINEST(yVals, xVals^{1,2})

array enter into a row of two cells, or three if you want the final

constant

should give you the coefficients a, b & c in =a*x^2 + b*x + c

yVals & xVals being equal sized ranges which could be named

Regards,
Peter T


"Steve R" wrote in message
...
Is there a way to automatically insert the coefficients of a second

order
polynomial regression based on three or four data points into

prescribed
cells or must they be copied from the equation derived by adding a

trendline
to an XY-chart? Thanks.








All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com