With MAXQDA Stats you can perform calculations on a selected variable and store the result in a new variable. To begin the calculation, select the function Transform > Compute variable from the Stats main menu. The following window will appear:

When calculating variables, proceed as follows:
- In the upper pane of the window, assign a new variable name and a label if required. If the variable name already exists, MAXQDA will indicate it in red. The newly created variable will automatically be assigned the type “Floating”.
- In the lower pane “Numerical expression”, assign an evaluation instruction. If the input cannot be evaluated, for example because a bracket or a summand is missing, MAXQDA will indicate so in blue as displayed in the screenshot.
In the “Variable” section, all “Integer” and “Floating point” type variables are listed. All variables are numbered consecutively from “V1” to “Vn”, with the variable name (or the label if present) enclosed in square brackets. When proceeding with the calculation, the identifier must be inputted as displayed in the screenshot above.
In the right hand pane, “Functions”, frequently used functions including the applied syntax are listed. Click the function buttons to insert the function in the calculation pane.
Function | Meaning |
+ - * / | Add, subtract, multiply, divide |
^ | Exponent, for example “V1^2” is the variable “V1” squared |
avg(a, b, …) | Arithmetic mean of all variables or arithmetic expressions enclosed in the parentheses (separated by commas). Any number of variables or arithmetic expressions can be enclosed in the parentheses. |
sum(a, b, …) | Sum of all variables or arithmetic expressions enclosed in the parentheses (separated by commas). Any number of variables or arithmetic expressions can be enclosed in the parentheses. |
sqrt(a) | Root of the expression in parentheses |
round(a) | The arithmetic expression in parentheses will be rounded to the next whole number |
roundn(a, decimals) | The arithmetic expression in parentheses will be rounded to the specified number of decimal places |
When you click OK, the new variable will be calculated and displayed in the Data Editor.
You can also include if-then conditions in the calculation. The following examples illustrate the syntax to be used:
if (V1 > V2) {
V1
}
else {
V2
}
Alternative Syntax:
if (V1 > V2)
V1;
else
V2