Replaces the contents of the result variable with the sample standard deviation of the input vector.
If the keyword divn is present, STDEV replaces the contents of the result variable with the population standard deviation of the input vector.
As an alternate to divn, you can use pop, which is more mnemonic of the fact that it forces calculation of the "population Standard Deviation".
Missing values, represented by "NaN" or ".", are ignored in the computation of the standard deviation.
Usage with the LET command
You can use STDEV as a function in the LET command. By default, it will compute the sample standard deviation. If you want to use it to compute population standard deviation, use the name STDEV_POP, which is only valid within a LET command.
COPY (75 60 82 95 88 79 69 74 89) grades STDEV divn grades stdDev PRINT stdDev
The above program produced the following result:
The next program uses the STDDEV command to demonstrate that the NORMAL command is producing samples with the specified standard deviation, 20 in this case.
NORMAL 1000 50 20 data STDEV data stddev PRINT stddev
The above program produced the following result in three separate runs:
stddev: 20.210423155545627 stddev: 20.078498279769832 stddev: 19.671205265384145