<< Click to Display Table of Contents >> Navigation: User Guide > Project definition > Variables > Variables with a calculated value |
See Project components for a brief introduction to variables.
This topic describes integer and float variables.
These variables have a value and are very similar to integer and float questions in that a variable can be:
•Filtered, and will be "undefined" if any of the applied filters are false
•Referred to in exactly the same way as a question in logic definitions and analysis
The differences are that a variable:
•Is not normally seen during an interview
•Is not normally stored in the data file
•Is recalculated whenever it is needed
•Has an arithmetic definition and a text that describes it
Integer and float variables can be created by:
•Requesting a new variable entry and adding the arithmetic definition
•Copying a value question to a variable so that the variable refers to the question
•Copying a value question to the clipboard and pasting as a variable
•Creating a new variable to contain the count of the number of responses selected in a multi-coded entry, see Entry details window menu
•Creating a new variable to contain the score value from the selected response in a single-coded (or multi-coded) entry, see Entry details window menu
•Creating a new variable to contain the smallest (min) value found in a list of other entries
•Creating a new variable to contain the largest (max) value found in a list of other entries
In both integer and float variables the whole calculation is done using double precision floating point arithmetic (approximately 14 significant digits).
Integer variables should only be used when the calculated value for each respondent will be a whole number of less than 18 digits. If a respondent calculated value is not a whole number then it will be rounded to the nearest whole number in an integer variable.
If any value used in the arithmetic is undefined (missing or filtered) then the calculated value is undefined. You can set "Treat undefined as zero" so that any missing values will be treated as having a value of zero.