====== valueSD() ======
''float **valueSD**(string //question//)''
''float **valueSD**(string //question//, string|array //items//)''
''float **valueSD**(array //variables//)''
Calculates the [[http://en.wikipedia.org/wiki/Standard_deviation|standard deviation]] of the answer codes for all items in a question (e.g. a scale), for selected items, or for a list of variables.
* //question// -- ID of a question (as a string)
* //items// -- A list (string or array) of items
* //variables// -- A list (array) of variable IDs as stated in the **Variables Overview**
**Note:** This works in the same way as ''[[:de:create:functions:valuesum|valueSum()]]'' -- the parameters are described in this chapter in detail with various examples.
===== Examples =====
The following PHP code identifies participants who always selected the same value (straight-lining) in the scale "AB01", and sends them to the end of the questionnaire immediately.
$sd = valueSD('AB01');
if ($sd == 0) {
goToPage('end');
}
The following PHP code displays a message to participants who predominately chose the same value in the scale "AB02".
$sd = valueSD('AB02');
if ($sd < 0.25) {
text('think more');
}
**Note:** The standard deviation of a scale is not a valid indication of data quality in a questionnaire. ((Leiner, Dominik J. (2014). Too Fast, Too Straight, Too Weird. Post Hoc Identification of Meaningless Data in Internet Surveys. Available on https://www.researchgate.net/publication/258997762)). Only use the above examples with the utmost caution.