Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking the Regression equation of a line to a table

I am using 3 points to create a line, and the trendline utility to display
the display the equation of a line on the graph. I am trying to create a
table that automatically calculates values based on the equation of that
line.
Rough description:
x-axis values range from 0.25 to 1.00
Y-axis values range from 1000 to 15000

If the regression equation is y = -20200*x^2 + 5686.7*x + 7482.2, I want to
be able to create a table in which Column A ("x" values) ranges from 0.25 to
1.0, and column B automatically utilizes the regression equation to insert
"y" values. The regression equation changes, so I need the values in Coulmn
B ("y" values) to automatically update as the equaiton changes.

A B
1 0.25
2 0.26
3 0.27
4 0.28
5 0.29
6 0.3
7 0.31
8 0.32
9 etc,etc.

Currently, I am forced to manually input the regression equation into a
table each time it changes to re-calculte the needed "y" values in that
table. For the equation y = -20200*x^2 + 5686.7*x + 7482.2

A B C D
1 -2.02E+04 5686.7 7482.2 x-values
2
3
4 -7031 1.00
5 -6686 0.99
6 -6345 0.98
7 -6008 0.97
8 -5675 0.96
9 -5346 0.95
etc etc etc

So, I have to create a formula that reads =($A$1*D4^2)+($B$1*D4)+$C$1
--Example is for Cell A4, however is dragged into every cell in Column A.
As the equation of the line changes, I am forced to manually enter the
values in A1, B1, and C1 to have the table refresh.

I hope my question makes sense




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Linking the Regression equation of a line to a table

You don't need to write a VBA program for this; simply use the LINEST function
=LINEST(ydata,xdata^{1,2}) will fit a quadratic.

Jerry

"Ch1ck3n Fock3r" wrote:

I am using 3 points to create a line, and the trendline utility to display
the display the equation of a line on the graph. I am trying to create a
table that automatically calculates values based on the equation of that
line.
Rough description:
x-axis values range from 0.25 to 1.00
Y-axis values range from 1000 to 15000

If the regression equation is y = -20200*x^2 + 5686.7*x + 7482.2, I want to
be able to create a table in which Column A ("x" values) ranges from 0.25 to
1.0, and column B automatically utilizes the regression equation to insert
"y" values. The regression equation changes, so I need the values in Coulmn
B ("y" values) to automatically update as the equaiton changes.

A B
1 0.25
2 0.26
3 0.27
4 0.28
5 0.29
6 0.3
7 0.31
8 0.32
9 etc,etc.

Currently, I am forced to manually input the regression equation into a
table each time it changes to re-calculte the needed "y" values in that
table. For the equation y = -20200*x^2 + 5686.7*x + 7482.2

A B C D
1 -2.02E+04 5686.7 7482.2 x-values
2
3
4 -7031 1.00
5 -6686 0.99
6 -6345 0.98
7 -6008 0.97
8 -5675 0.96
9 -5346 0.95
etc etc etc

So, I have to create a formula that reads =($A$1*D4^2)+($B$1*D4)+$C$1
--Example is for Cell A4, however is dragged into every cell in Column A.
As the equation of the line changes, I am forced to manually enter the
values in A1, B1, and C1 to have the table refresh.

I hope my question makes sense




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a graph for a given regression equation? JJaya Charts and Charting in Excel 6 September 2nd 08 08:30 PM
One regression line Prba Charts and Charting in Excel 1 February 24th 06 04:16 PM
How do I put a regression line on a scatter chart Charles Hall Charts and Charting in Excel 2 February 14th 06 02:20 AM
Graphing a logarithmic regression line Susiebusie Charts and Charting in Excel 3 November 18th 05 07:26 PM
creating a regression line in a graph sirsoto Charts and Charting in Excel 1 November 10th 05 02:20 AM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"