## Tuesday, 31 December 2013

### OBIEE 11g Release 11.1.1.7 – Evaluate Statistical Function –Linear Regression

Statistics functions are used to compute covariance, correlation, and linear regression statistics. Each function operates on an unordered set. They also can be used as windowing and reporting functions.

Linear Regression

This example computes an ordinary least-squares regression line that expresses the Avg Order Size as a linear function of its Revenue. The following functions are used:

SLOPE - slope of determination of the regression line

INTERCEPT - intercept of determination of the regression line

REG LINE – Line co-ordinates based on slope and intercept

Calculation Example

#### Calculation for Analytics Using Evaluate Function

Intercept
EVALUATE_AGGR( 'REGR_INTERCEPT(%1, %2)', "Base Facts"."1- Revenue","Simple Calculations"."25  Avg Order Size")

Slope
EVALUATE_AGGR( 'REGR_SLOPE(%1, %2)', "Base Facts"."1- Revenue","Simple Calculations"."25  Avg Order Size")

Reg Line
AGGREGATE(EVALUATE_AGGR( 'REGR_SLOPE(%1, %2)', "Base Facts"."1- Revenue","Simple Calculations"."25  Avg Order Size") BY 1)* AGGREGATE("Simple Calculations"."25  Avg Order Size" BY "Time"."Per Name Month")+EVALUATE_AGGR( 'REGR_INTERCEPT(%1, %2)', "Base Facts"."1- Revenue","Simple Calculations"."25  Avg Order Size")

#### Notes

EVALUATE_AGGR is used for shipping function to database for intercept, slope and Reg Line

#### Result – Table View/Graph View

This example is taken from the Sample Apps. I hope you find this copy/pasted information useful.