Difference between revisions of "Documentation/How Tos/Calc: SLOPE function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(See also:)
m
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:SLOPE function}}
 +
{{Documentation/CalcFunc StatisticalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_RSQ_function
 +
|NextPage=Documentation/How_Tos/Calc:_STEYX_function
 +
}}__NOTOC__
  
 
== SLOPE ==
 
== SLOPE ==
Line 27: Line 32:
 
: where the x values in A2:A6 are 1, 2, 3, 4, 5 and the y values in B2:B6 are 2, 4, 6, 8, 11 returns <tt>'''2.2'''</tt>. The equation of the straight line found is very nearly <i>y</i> = 2<i>x</i> - thus the slope is very nearly (but not quite) 2.
 
: where the x values in A2:A6 are 1, 2, 3, 4, 5 and the y values in B2:B6 are 2, 4, 6, 8, 11 returns <tt>'''2.2'''</tt>. The equation of the straight line found is very nearly <i>y</i> = 2<i>x</i> - thus the slope is very nearly (but not quite) 2.
  
=== See also: ===
+
{{SeeAlso|EN|
[[Documentation/How_Tos/Calc: FORECAST function|'''FORECAST''']],
+
* [[Documentation/How_Tos/Calc: FORECAST function|FORECAST]]
[[Documentation/How_Tos/Calc: INTERCEPT function|'''INTERCEPT''']],
+
* [[Documentation/How_Tos/Calc: INTERCEPT function|INTERCEPT]]
[[Documentation/How_Tos/Calc: STEYX function|'''STEYX''']]
+
* [[Documentation/How_Tos/Calc: STEYX function|STEYX]]
 
+
* [[Documentation/How_Tos/Using Arrays|Array formulas]]
[[Documentation/How_Tos/Using Arrays|'''Array formulas''']]
+
* [[Documentation/How_Tos/Calc: Statistical functions|Statistical functions]]
 
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
[[Documentation/How_Tos/Calc: Statistical functions|'''Statistical functions''']]
+
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
+
[[Category: Documentation/Reference/Calc/Statistical functions]]
[[Documentation/How_Tos/Calc: Functions listed alphabetically|'''Functions listed alphabetically''']],
+
[[Documentation/How_Tos/Calc: Functions listed by category|'''Functions listed by category''']]
+

Latest revision as of 14:46, 2 February 2024



SLOPE

Fits a straight line to data using linear regression and returns its slope.

Syntax:

SLOPE(yvalues; xvalues)

yvalues and xvalues are single row or column ranges specifying points in a set of data. yvalues and xvalues must be the same size.
SLOPE fits a straight line through these data points, using the linear regression method (least squares). It then returns the slope of that line.
The equation of a straight line may be given as y = a + bx. The linear regression method calculates:
Calc linregress b.png
and
Calc linregress a.png.
b is the slope, returned by this function.


Advanced topic:
The parameters xvalues and yvalues are always evaluated as array formulas.

Example:

SLOPE(B2:B6; A2:A6)

where the x values in A2:A6 are 1, 2, 3, 4, 5 and the y values in B2:B6 are 2, 4, 6, 8, 11 returns 2.2. The equation of the straight line found is very nearly y = 2x - thus the slope is very nearly (but not quite) 2.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_SLOPE_function&oldid=260078"
Views
Personal tools
Navigation
Tools