View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Lucile Lucile is offline
external usenet poster
 
Posts: 16
Default polynomial regression

Thanks everybody fro your help... But it is not working!

First I know that a 5th order polynomial regression is too much, but it is
what I have to do for now. And with a 3rd order I will have the same
problem...

I tried evaluate... But what I understand is I have to define my range and
not only put a range name...

I tried:

lastrow = Cells(Rows.Count, 1).End(xlUp).Row

x = Range(Cells(2, 1), Cells(lastrow, 1))
y = Range(Cells(2, 7), Cells(lastrow, 7))

M = [linest(y,x^{1,2,3,4,5})]

ActiveCell = M

--- It gives me #NAME?

And:

lastrow = Cells(Rows.Count, 1).End(xlUp).Row

x = Range(Cells(2, 1), Cells(lastrow, 1))
y = Range(Cells(2, 7), Cells(lastrow, 7))

a=application.index(application.linest(y,x^{1,2,3, 4,5}),1)

--- It gives invalid character for { }

I really need to find a way to do that!
Thanks!

"Mike Middleton" wrote:

Lucile -

(1) I suggest that you think seriously about whether you have data that
should be analyzed using a 5th order polynomial. Use google to search for
"regression overfit" (without the quote marks).

(2) The correct order of the arguments for LINEST is known_y first and
known_x second. It's the known_x data that are raised to the various powers.

(3) Show the VBA code you are using. One approach is to use FormulaArray and
build the arguments as concatenated text strings, in which case the curly
brackets are part of a text string enclosed in double-quote marks.

- Mike Middleton
http://www.MikeMiddleton.com
Excel Add-ins and Books for Data Analysis and Decision Analysis



"Lucile" wrote in message
...
Hello,
I need to do a polynomial regression, 5th order.
I think I am using the right formula: application.linest(x,y^{1,2,3,4,5})
My problem is that {} is not accepted! Invalid character.
I am using excel 2000.

What can I do to fix this problem?
Thanks