Variable types explained

<< Click to Display Table of Contents >>

Navigation:  User Guide > Project components >

Variable types explained

A variable is very similar to a question, but it is not asked.

The answer to a variable is constructed from other entries.

Variable with responses

These variables have a numbered response list.

Every response has a logic definition and the response is selected if the logic definition is true.

Single-coded

In a single-coded variable only the first true response in the list is selected, subsequent true responses are ignored.

Multi-coded

In a multi-coded variable all true responses are selected.

Variable with a value

These variables use an arithmetic definition to calculate the answer.

An arithmetic definition is some syntax that refers to other entries, for example:

"$Q2*3" would multiply the value of Q2 by 3.

Arithmetic definitions can refer to the answers to questions and variables.

Complex arithmetic definitions can be constructed that:

Refer to many different entries and constant values

Use "add", "subtract", "multiply" and "divide" to combine tests

Use parentheses "(" and ")" to control the order of calculation

Have special functions:

oCount the number of responses given to a multi-coded question (CT function)

oExtract the relevant score value from a single-coded entry (SCORE function)

As well as referring to other integer and float entries, an arithmetic definition can refer to a single-coded entry.  The value used is the response number selected, or zero if none are selected.

Integer

In an integer variable the answer will be rounded to the nearest whole number if it is not a whole number.

Float

The answer in a float variable is stored including any decimal places.

You can the number of decimal places to use when storing the value.