polynomial regression

  • Thread starter Thread starter Duane Kibby
  • Start date Start date
D

Duane Kibby

Help,

linestResults() = Application.WorksheetFunction. _
LinEst(y, x^{1,2},true, True)

When trying to use this form of the "Linest" function, I
get a "Invalid Character" error at the "{" character.
Nothing seems to work.

Thanks in advance,
Duane
 
Duane,
AFAIK, you cannot call the wks functions from VBA with the same syntax
you use in the worksheets when it comes to array-entered functions.
Alternatives:
Set up a veryhidden worksheet with X, enter the LINEST formula into
another cell, do the calc, grab the result.

Hmmm, others come to minf, but they might be flakier.

HTH

Dave Braden
 
VBA doesn't do array entry of worksheet functions. If x and y are
ranges, you could use

Evaluate("LinEst(" & y.Address & "," & x.Address & "^{1,2},true, True)")

Jerry
 
Back
Top