apoc.coll.stdev

Details

Syntax

apoc.coll.stdev(list [, isBiasCorrected ])

Description

Returns sample or population standard deviation with isBiasCorrected true or false respectively.

Arguments

Name

Type

Description

list

LIST<INTEGER | FLOAT>

A list to collect the standard deviation from.

isBiasCorrected

BOOLEAN

Will perform a sample standard deviation if isBiasCorrected, otherwise a population standard deviation is performed. The default is: true.

Returns

INTEGER | FLOAT

The functionality of apoc.coll.stdev() is available using Cypher’s stDev() and stDevP() functions.

Usage examples

The following examples compute the standard deviation of values in a list using both APOC and Cypher:

apoc.coll.stdev
WITH [1,2,3,4,5] AS list
RETURN apoc.coll.stdev(list) AS output
Using Cypher’s UNWIND and stDev()
UNWIND [1,2,3,4,5] AS x
RETURN stDev(x) AS output
Results
output

1.5811388300841898

The following examples compute the standard deviation of values over an entire population in a list using both APOC and Cypher:

apoc.coll.stdev
WITH [1,2,3,4,5] AS list
RETURN apoc.coll.stdev(list, false) AS output
Using Cypher’s UNWIND and stDevP()
UNWIND [1,2,3,4,5] AS x
RETURN stDevP(x) AS output
Results
output

1.4142135623730951