# R squared and R adjusted • ### 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].&:[Date].[Date].&}, [Measures].[Ratio to Parent])

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

)

select [Measures].[Test] on 0

• 