Data Types and Measurement Scales
MIDAS automatically infers data types and measurement scales when loading data. Data type and measurement scale are independent concepts: data type describes how the value is represented (number, date, text, etc.), while measurement scale describes its analytical properties (nominal, ordinal, interval, ratio). Measurement scales filter which items appear in The Statistics Tab — statistics that do not fit the scale are not displayed — so verify the scale is correct after loading.
For the list of data types and the rules by which MIDAS decides the data type of a column at import, see Importing and Reloading Data.
Measurement Scales
Measurement scales classify "what operations are meaningful for a given data". Based on Stevens' (1946) four levels of measurement. The scales form a hierarchy — nominal < ordinal < interval < ratio — where higher scales support more operations and include all operations available to lower scales. MIDAS uses this classification to filter which statistics are displayed. The scale level alone does not uniquely determine the analysis method, so set the scale according to the meaning of your data and change it after loading if needed.
Nominal Scale
Data representing categories with no meaningful order. Only equality (, ) is meaningful.
Examples: Gender (male/female), colors (red/blue/green), country names
Ordinal Scale
Categories with meaningful order, but no defined interval between values. Comparisons (, ) are meaningful.
Examples: Satisfaction (low/medium/high), grade level (1st/2nd/3rd year), grades (A/B/C/D)
Interval Scale
Equally spaced numeric data where differences are meaningful, but ratios are not. The zero point is arbitrary.
Examples: Temperature (Celsius), year (AD)
- The difference between 20°C and 10°C is a meaningful 10°C
- However, 20°C is not "twice as warm" as 10°C
Ratio Scale
Equally spaced numeric data with a true zero point. Both differences and ratios are meaningful.
Examples: Height, weight, price, age
- The difference between 20kg and 10kg is a meaningful 10kg
- Furthermore, 20kg is "twice as heavy" as 10kg
Ratio scale is not assigned by auto-inference. Whether zero represents a true origin depends on the meaning of the data and cannot be determined from values alone. For data with a true zero point such as height or weight, right-click the column header in the Data Table and set ratio scale from Edit Scale of Measurement. Setting ratio scale adds the coefficient of variation (cv) and the geometric mean (geo mean) to basic statistics. See The Statistics Tab for the display conditions.
Auto-Inference from Data Types to Measurement Scales
MIDAS determines data types on import and automatically assigns measurement scales. Auto-inference is only an initial value, and the measurement scale can be changed after loading. String and enum columns store their values as text, however, so only the nominal and ordinal scales are available for them. To treat such values on an interval or ratio scale, convert the column to a numeric type in the Convert Column Types tab first.
| Data Type | Inferred Scale | Reason |
|---|---|---|
| boolean | Nominal | true/false are unordered categories |
| int64 | Interval | Differences between numbers are meaningful, but whether zero represents a true origin depends on the data |
| float64 | Interval | Same as integers |
| date | Interval | Date differences are meaningful, but ratios of dates are not |
| datetime | Interval | Same as dates |
| string | Nominal | Text is treated as categories |
| enum | Nominal | Even when an order is defined, whether the analysis uses it is made explicit by the scale setting |
Auto-inference may not match the actual meaning of the data. For example, postal codes and ID columns are loaded as numeric and assigned interval scale, but they are semantically nominal. For these columns, right-click the column header in the Data Table and select Edit Scale of Measurement to change to the appropriate scale.
For ordered categories stored as text, create an Enum definition and convert the column to Enum type. A string column cannot define the order of its values, so changing the scale to ordinal only shows frequency counts; order-based statistics such as the median are not computed. Data type and measurement scale are independent, so defining the order in an Enum does not automatically change the scale to ordinal. After converting to Enum type, change the scale to ordinal from Edit Scale of Measurement.
References
- Stevens, S. S. (1946). On the theory of scales of measurement. Science, 103(2684), 677-680. https://www.jstor.org/stable/1671815
See also
- Importing and Reloading Data - The list of data types and the rules for deciding the data type of a column at import
- The Statistics Tab - Statistics displayed by measurement scale
Also available as a Markdown file.