The type of a variable indicates how it should be interpreted when being analyzed. Sometimes the variable type is incorrectly set in a data file and most analysis programs permit the user to change the variable type to a more appropriate setting.
A variable that contains data where it is meaningful to compute an average (e.g., height, weight, number of chocolates eaten in the past week). In SPSS this is referred to as a scale variable.
A variable where each unique value indicates a particular category. For example, a 1 may indicate that somebody is male and a 2 may indicate that somebody is a female. Note that it is not meaningful to compute an average of a categorical variable.[note 1] Such variables are sometimes referred to as being nominal.
A categorical variable where each value indicates a particular category and the ordering of the values has a meaning. For example, a 1 may indicate being aged 18 to 34, a 2 may indicate an age of 35 to 54, and a 3 may represent 55 or more. Such variables are sometimes referred to as being ordinal variables.
Most analysis programs only provide limited support for ordered categorical variables, treating them as if they are (unordered) categorical variables.[note 2] Consequently, it is commonplace to treat ordered categorical variables as being numeric.
A numeric variable which contains a date. In more sophisticated programs, such as Q, special-purpose analysis methods exist to manipulate date variables (e.g., to automatically create moving averages, aggregate date periods, etc).
A numeric variable that contains money. Generally, this is identical to a numeric variable in all ways except that the currency symbol is shown on tables.
A variable containing text information. Most commonly, such a variable will either contain data from an open-ended question, or, will contain numeric or categorical data that has been stored with the wrong variable type.
- Although it is possible to draw conclusions from such an average. For example, an average of 1.5 would equate to 50% males and 50% females.
- There are a small number of exceptions to this. In particular:
- SPSS's scaling tools will automatically treat ordered categorical variables differently.
- Q's regression will fit an ordered logit model to ordered categorical dependent variables.
- Q's statistical testing will automatically use a non-parametric test if comparing an ordered categorical variable with a categorical variable.