Calculate a variable
This assistant allows to set a calculation (new variable calculated) on one/many variable(s) pre-existing in the survey. To calculate a variable, proceed as follows :
- From the tab Data, click Calculate
The assitstant proposes to select one of the six functions of calculation :
- Age : allows to calculate the difference between a date variable (year of birth) and the current date (today).
- Duration : allows to calculate the difference between two date variables.
- Sum : to calculate the sum of effective values of several numerical or scale variables, (for the scale variables, a scale should be affected beforehand).
- Average : to calculate the average of effective values of several numerical or scale variables, (treat the scales in number).
- Standard deviation : allows to calculate the standard deviation of effective values of several numerical or scale variables (for the scale variables, a scale should be affected beforehand).
- Standard normal distribution : To calculate a variable independent of the unity, with the same average and the same dispersion.
It is important to note that the variable created doesn't keep the calculation in memory. Thus, in case of adding the observations after creating the variable, the latter will not be updated, and the calculations will not be done on the new responses.
In this example, we wish to calculate the average budget of the consumed beverages, all types of beverages confused.