measurementLevel Property (Python)

The measurementLevel property of a Variable object gets or sets the measurement level of a variable. The measurement level is specified as a string. When setting the measurement level the allowed values are: "NOMINAL", "ORDINAL", and "SCALE". When getting the measurement level the additional value "UNKNOWN" may be returned for numeric variables prior to the first data pass when the measurement level has not been explicitly set, such as data read from an external source or newly created variables. The measurement level for string variables is always known.

Example

varObj = datasetObj.varlist['minority']
#Get the measurement level
level = varObj.measurementLevel
#Set the measurement level
varObj.measurementLevel = "NOMINAL"