Cypher stDevP Function

stDevP() returns the standard deviation for the given value over a group. It uses a standard two-pass method, with N as the denominator, and should be used when calculating the standard deviation for an entire population. When the standard variation of only a sample of the population is being calculated, stDev should be used.

Syntax: stDevP(expression)

Returns: A Float

Arguments

NameDescription
expressionA numeric expression.

Example

MATCH (n:Person)
RETURN stDevP(n.age)

The population standard deviation of the values in the property age for all nodes of the type ‘Person’ is returned.

Considerations

  • All null values are excluded from the calculation.
  • stDevP(null) returns 0.

Example

UNWIND [8, 9, 10, 11, 12, 15] AS val
RETURN stDevP(val)

Returns the following Result

stDevP(val)
2.266911751455907