Translations of this page:


float valueSD(string question)

float valueSD(string question, string|array items)

float valueSD(array variables)

Calculates the 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 valueSum() – the parameters are described in this chapter in detail with various 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) {

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. 1). Only use the above examples with the utmost caution.

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
en/create/functions/valuesd.txt · Last modified: 29.09.2020 21:10 by sophia.schauer
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki