This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:
 

This is an old revision of the document!


valueMean()

float valueMean(string question)

float valueMean(string question, string|array items)

float valueMean(array variables)

Calculates the mean (average, expectation value) of the answer codes for all items in a question (e.g. a scale), 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 detail in this chapter with various examples.

Example

In the following example, question “AB02” will be displayed if the mean in the scale “AB01” is at least 1.5.

$mean = valueMean('AB01');
if ($mean >= 1.5) {
  question('AB02');
}
en/create/functions/valuemean.1421840112.txt.gz · Last modified: 21.01.2015 12:35 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki