# Documentation/Calc Functions/SLOPE

Jump to navigation
Jump to search

TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate

## Function name:

SLOPE

## Category:

Statistical Analysis

## Summary:

Calculates the slope of the linear regression line using the specified (x, y) points.

## Syntax:

SLOPE(**DataY**; **DataX**)

## Returns:

Returns a real number which is the slope of the linear regression line constructed through data points in **DataY** and **DataX**.

## Arguments:

**DataY** is a name, array, or reference to a range of cells containing the Y data.

**DataX** is a name, array, or reference to a range of cells containing the X data

- If a cell contains text or empty cells, then the function ignores these values. For logical values, TRUE is considered as 1 and FALSE as 0.
- If a cell contains 0 then the function includes it.
- If
**DataX**and**DataY**have different dimensions, then the function returns an error value.

## Additional details:

- The formula for SLOPE (β) is:

Here x̄ and ӯ are mean values for **DataX** and **DataY**, respectively. For a given slope a line is given as

y = α + βx

where

α = ӯ - βx̄.

- For more details on the slope of a linear regression line, visit Wikipedia.

## Examples:

DataY | DataX | |
---|---|---|

1 | 195 | 200 |

2 | 151 | 180 |

3 | 148 | 178 |

4 | 189 | 165 |

5 | 183 | 192 |

6 | 154 | 144 |

Formula | Description | Returns |
---|---|---|

=SLOPE(A1:A6;B1:B6) | Calculates the β parameter value expected for a linear trend based on the data. | 0.496617389125532 |

=SLOPE({8,9,10,11};{50,80,110,140}) | Calculates the β parameter value expected for a linear trend based on the data passed as array. | 0.033333333333333 |

## Related LibreOffice functions:

## ODF standard:

## Equivalent Excel functions:

SLOPE