Types of variables and levels of measurement
Numeric, categorical and Likert variables: how they differ and why they decide which test you can use.
5 min read
Before choosing a test, you need to know what kind of data each variable holds. The type decides what can be calculated: the average of "gender" means nothing, but the average of "age" does.
The three variable types in Lucidstat
When you import data, Lucidstat asks you to set each column to one of three types.
| Type in Lucidstat | Meaning | Examples |
|---|---|---|
| Numeric | Numbers you can meaningfully add, subtract and average | Age, exam score, income, study hours |
| Categorical | Group or category names with no order | Gender, faculty, teaching method, pass/fail |
| Ordinal / Likert | Ordered levels whose spacing may not be equal | Satisfaction 1–5, year of study, education level |
The four levels of measurement
Textbooks usually describe Stevens' (1946) four levels of measurement. They map onto Lucidstat's types like this:
- Nominal: numbers or names only label groups (1 = male, 2 = female). This is categorical.
- Ordinal: you can say more or less, but not by how much (1st, 2nd, 3rd place). This is ordinal.
- Interval: equal spacing but no true zero (temperature in °C). This is numeric.
- Ratio: equal spacing and a true zero (weight, income). This is numeric.
In practice, every test that works for interval data also works for ratio data, so Lucidstat groups both as "numeric".
What about Likert scales?
A single 1–5 item (strongly disagree to strongly agree) is ordinal in principle. Even so, much social-science research reports the mean and SD of Likert items and interprets the mean as a level such as "High" or "Very high". Lucidstat supports this; see Descriptive statistics.
Variable types decide the test
| Research question | Variable types | Suitable test |
|---|---|---|
| Do two groups differ in their means? | Group (2) + numeric | Independent t-test |
| Do three or more groups differ? | Group (≥ 3) + numeric | One-way ANOVA |
| Are two variables related? | Numeric + numeric | Pearson correlation |
| Are two categorical variables related? | Categorical + categorical | Chi-square test |
| Do several variables predict an outcome? | Several numeric + numeric | Multiple regression |
Not sure? The test wizard asks about your variables one question at a time and recommends a test.
Common mistakes
- Leaving numeric codes as numeric. If gender is coded 1/2 and not set to categorical, the software will happily compute an average gender, which is meaningless.
- Text mixed into a numeric column, such as "n/a" or "-". Lucidstat lists the rows with problems so you can fix them or mark them as missing.
- Averaging a categorical variable. Report categorical variables as counts and percentages.
References
- Stevens, S. S. (1946). On the theory of scales of measurement. Science, 103(2684), 677–680.