Value Labels or Formats (and Measurement Level)

  • Robert A Muenchen
Part of the Statistics and Computing book series (SCO)

This section blends two topics because in R they are inseparable. In both SAS and SPSS, assigning labels to values is independent of the variable's measurement level. In R, you can assign value labels only to variables whose measurement level is factor. To be more precise, only objects whose class is factor can have label attributes.

In SAS, a variable's measurement level of nominal, ordinal, or interval is not stored. Instead, you list the variable on a specific statement, such as CLASS or BY, to tell SAS that you wish to view it as categorical.

SAS' use of value labels is a two-step process. First, PROC FORMAT creates a “format” for every unique set of labels and then the FORMAT statement assigns a format to each variable or set of variables (see example program below, Table 15.1). The formats are stored outside the dataset in a format library.
Table 15. 1

Example programs for value labels or formats (&measurement level)

SAS programming statements

* SAS Program to Assign Value Labels...

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  • Robert A Muenchen
    • 1
  1. 1.University of TennessceKnoxvilleUSA

Personalised recommendations