spssdictionary.GetVariableMeasurementLevel Function (R)
spssdictionary.GetVariableMeasurementLevel(variable). Returns a string value that indicates
the measurement level for the specified variable in the active dataset. The argument is the name of the variable in quotes or the index
value of the variable. Index values represent position in the active
dataset, starting with 0 for the first variable in file order. The
value returned can be: "nominal"
, "ordinal"
, "scale"
, or "unknown"
.
- "Unknown" occurs only 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
varlevel <- spssdictionary.GetVariableMeasurementLevel(0)