This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:functions:statistic [11.12.2014 21:31] – alexander.ritter | en:create:functions:statistic [29.09.2020 18:13] – sophia.schauer | ||
---|---|---|---|
Line 14: | Line 14: | ||
* ''' | * ''' | ||
* ''' | * ''' | ||
+ | * ''' | ||
+ | * ''' | ||
+ | |||
* // | * // | ||
* // | * // | ||
Line 22: | Line 25: | ||
**Note:** Test data collected during the developing of the questionnaire and pretesting is only included if the current questionnaire is a part of the test as well. If the questionnaire is being carried out as part of the regular data collection, '' | **Note:** Test data collected during the developing of the questionnaire and pretesting is only included if the current questionnaire is a part of the test as well. If the questionnaire is being carried out as part of the regular data collection, '' | ||
+ | **Note:** The data from the current interview are not considered by '' | ||
+ | |||
+ | **Tip:** The function '' | ||
+ | |||
+ | **Tip:** If you do not want to count all completed interviews (e.g. if dropouts were redirected to another page using '' | ||
===== Frequency Count ===== | ===== Frequency Count ===== | ||
Line 95: | Line 103: | ||
} else { | } else { | ||
// answer options text (statistic() only provides the numeric code) | // answer options text (statistic() only provides the numeric code) | ||
- | $text = getValuetext(' | + | $text = getValueText(' |
html(' | html(' | ||
< | < | ||
Line 118: | Line 126: | ||
< | < | ||
'); | '); | ||
+ | </ | ||
+ | |||
+ | ===== Evaluate partial data sets ===== | ||
+ | |||
+ | By using '' | ||
+ | |||
+ | The number of cases matching the filter is returned. The fourth parameter //AllData// only affects the return value, but not the further counting. | ||
+ | |||
+ | <code php> | ||
+ | // Statistics on female respondents only (SD02 = 1) | ||
+ | // RT variables are loaded immediately to reduce latency | ||
+ | $n = statistic(' | ||
+ | // Mean value of ratings (women only) | ||
+ | $mean1 = statistic(' | ||
+ | $mean2 = statistic(' | ||
+ | $mean3 = statistic(' | ||
+ | </ | ||
+ | |||
+ | The filter allows common comparison operators (''>'', | ||
+ | |||
+ | **Note:** Comparisons are only possible between one variable and a constant value (a number or string), e.g. '' | ||
+ | |||
+ | <code php> | ||
+ | // Statistics only on female respondents (SD02 = 1) aged 35 and over (SD03 >= 35) | ||
+ | $n = statistic(' | ||
+ | </ | ||
+ | |||
+ | Besides the variable names you can also use '' | ||
+ | |||
+ | <code php> | ||
+ | // Statistics only on female respondents (SD02 = 1) aged 35 and over (SD03 >= 35) in the German language version | ||
+ | $n = statistic(' | ||
</ | </ |