none
R squared and R adjusted RRS feed

  • Question

  • Hi!

    I try to make linear regression in multiple dimensions

    with SSAS (y = a + a1*x1+ ... a2*xn)

     

    I got the equation, but I also want to see R squared and R adjusted in same manner as in Excel.

    How to achieve that?

     

    Thanks

    Wednesday, December 12, 2007 9:09 AM

All replies

  • I'll admit that the math is over my head. But let me see if I can point you in the right direction.

     

    1. Have you looked at the LinReg* MDX functions. You might specifically look at the LinRegR2 function:

    http://msdn2.microsoft.com/en-us/library/ms145494.aspx

     

    2. You can call *some* excel functions directly from MDX. Here is the complete list.

    http://msdn2.microsoft.com/en-us/library/aa178231(SQL.80).aspx

     

    I assume you were talking about the RSq function in Excel? If so, something like the following might work. (Just an example of how to call it... no idea what numbers it's computing.)

     

    Code Block

    with

    member [Measures].[Ratio to Parent] as

    [Measures].[Internet Sales Amount]/([Date].[Date].[All Periods],[Measures].[Internet Sales Amount])

    member [Measures].[Test] as Excel.RSq(

    SETTOARRAY({[Date].[Date].&[1]:[Date].[Date].&[3]}, [Measures].[Ratio to Parent])

    ,SETTOARRAY({[Date].[Date].&[4]:[Date].[Date].&[6]}, [Measures].[Ratio to Parent])

    )

    select [Measures].[Test] on 0

    from [adventure works]

     

     

    Friday, December 14, 2007 5:06 PM
    Moderator
  • By the way, if you use Excel functions in MDX, you'll need Excel 2003 or Excel 2007 installed on the Analysis Services server.

     

    Friday, December 14, 2007 8:15 PM
    Moderator