# LinRegSlope (PEL)

This function calculates the linear regression of the values defined by a scope expression, and returns the value of the slope in the regression line, `y = ax + b`.

``````LinRegSlope(
Scope_Expression,
Numeric_Expression_y
[ , Numeric_Expression_x ]
)
``````

#### Parameters

• Scope_Expression
A valid PerformancePoint Expression Language (PEL) expression that returns a scope.
• Numeric_Expression_y
A valid numeric expression that is typically a PEL expression of cell coordinates that return a number, which represents values for the y-axis.
• Numeric_Expression_x
A valid numeric expression that is typically a PEL expression of cell coordinates that return a number, which represents values for the x-axis.

## Return Value

After obtaining the set of points, the LinRegSlope function returns the slope of the regression line (a in the equation `y = ax + b`).

## Remarks

Linear regression uses the least-squares method to calculate the equation of a regression line (that is, the best-fit line for a series of points). The regression line has the following equation, where a is the slope and b is the intercept:

`y = ax + b`

The LinRegSlope function evaluates the specified scope against Numeric_Expression_y to obtain the values for the y-axis. The function then evaluates the specified scope expression against Numeric_Expression_x, if it is specified, to obtain the values for the x-axis.

If Numeric_Expression_x is not specified, the function uses the current context of the cells in the specified scope as the values for the x-axis. Not specifying the x-axis argument is frequently used with the Time dimension.

To determine the y-intercept of the regression line `y = ax + b`, use LinRegIntercept (PEL).

The PEL compiler cannot generate SQL code for this function.