close

Hi

I am trying to call the excel function linest from VB from an MS Access
application .

the call
Slope1 =
Excel.WorksheetFunction.Index(Excel.WorksheetFunct ion.LinEst(y, x),1)

works fine as long as x is a one dimensional array.

But I need to do regression analysis for a multidimensional array (e.g.
I have x1,x2,x3,...,xn independent variables in the regression.)

so when I define x as say
dim x (10,2) as double

I get an error messages
quot;unable to get the linest property of the worksheet function classquot;

anyone know how to use linest for a multidimensioanl array ?

Thanks

You do not specify how you declared Y. It too must be a 2D array even
if it has just 1 column. So, declare it as Y(10,1). I just verified
that that works.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

In article gt;,says...
gt; Hi
gt;
gt; I am trying to call the excel function linest from VB from an MS Access
gt; application .
gt;
gt; the call
gt; Slope1 =
gt; Excel.WorksheetFunction.Index(Excel.WorksheetFunct ion.LinEst(y, x),1)
gt;
gt; works fine as long as x is a one dimensional array.
gt;
gt; But I need to do regression analysis for a multidimensional array (e.g.
gt; I have x1,x2,x3,...,xn independent variables in the regression.)
gt;
gt; so when I define x as say
gt; dim x (10,2) as double
gt;
gt; I get an error messages
gt; quot;unable to get the linest property of the worksheet function classquot;
gt;
gt; anyone know how to use linest for a multidimensioanl array ?
gt;
gt; Thanks
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()