Function slope
slope(
dependentY,independentX,name?):CalculatedMeasure
Calculates the slope of a linear-regression line for the given dependent and independent numeric attributes.
Note: Date and Time data types are not supported. Convert these types to custom numeric attributes.
Parameters
| Parameter | Type | Description |
|---|---|---|
dependentY | Attribute | Dependent-variable attribute (y) |
independentX | Attribute | Independent-variable attribute (x) |
name? | string | Optional name for the new measure |
Returns
A measure instance
Example
Calculate the slope of a linear regression line between Revenue and Cost
measureFactory.slope(DM.Commerce.Revenue, DM.Commerce.Cost)