Sample standard deviation: stddev_samp
Syntax
Aggregate syntax
in a Data Set expression |
stddev_samp ( dataset { groupingClause } ) |
in a Component expression within an aggr clause |
stddev_samp ( component ) { groupingClause } |
Analytic syntax
in a Data Set expression |
stddev_samp ( dataset over ( analyticClause ) ) |
in a Component expression within a calc clause |
stddev_samp ( component over ( analyticClause ) ) |
Input parameters
dataset |
the operand Data Set |
component |
the operand Component |
groupingClause |
see Aggregate invocation |
analyticClause |
see Analytic invocation |
Semantics for scalar operations
This operator cannot be applied to scalar values.
Input parameters type
dataset
dataset { measure<number> _+ }
component
component<number>
Result type
result
dataset { measure<number> _+ }
| component<number>
Additional Constraints
None.
Behaviour
The operator returns the “sample standard deviation” of the input values. For other details, see Aggregate and Analytic invocations.
Examples
Given the operand dataset DS_1:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Id_3 |
Me_1 |
---|---|---|---|
2011 |
A |
XX |
3 |
2011 |
A |
YY |
5 |
2011 |
B |
YY |
7 |
2012 |
A |
XX |
2 |
2012 |
B |
YY |
4 |
Example 1
DS_r := stddev_samp ( DS_1 group by Id_1 );
results in (see structure):
Id_1 |
Me_1 |
---|---|
2011 |
2.0 |
2012 |
1.414214 |