This is an old revision of the document!
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.
Note This works in the same way as valueSum()
– the parameters are described in this chapter in detail with various examples.
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'); }