Page 78 -
P. 78

HAN
                                                             2011/6/1
                                09-ch02-039-082-9780123814791
                                                                      3:15 Page 41
                                                                                    #3
                                                                2.1 Data Objects and Attribute Types  41


                                 The type of an attribute is determined by the set of possible values—nominal, binary,
                               ordinal, or numeric—the attribute can have. In the following subsections, we introduce
                               each type.


                         2.1.2 Nominal Attributes
                               Nominal means “relating to names.” The values of a nominal attribute are symbols or
                               names of things. Each value represents some kind of category, code, or state, and so nomi-
                               nal attributes are also referred to as categorical. The values do not have any meaningful
                               order. In computer science, the values are also known as enumerations.
                  Example 2.1 Nominal attributes. Suppose that hair color and marital status are two attributes
                               describing person objects. In our application, possible values for hair color are black,
                               brown, blond, red, auburn, gray, and white. The attribute marital status can take on
                               the values single, married, divorced, and widowed. Both hair color and marital status
                               are nominal attributes. Another example of a nominal attribute is occupation, with the
                               values teacher, dentist, programmer, farmer, and so on.

                                 Although we said that the values of a nominal attribute are symbols or “names
                               of things,” it is possible to represent such symbols or “names” with numbers. With
                               hair color, for instance, we can assign a code of 0 for black, 1 for brown, and so on.
                               Another example is customor ID, with possible values that are all numeric. However,
                               in such cases, the numbers are not intended to be used quantitatively. That is, mathe-
                               matical operations on values of nominal attributes are not meaningful. It makes no
                               sense to subtract one customer ID number from another, unlike, say, subtracting an age
                               value from another (where age is a numeric attribute). Even though a nominal attribute
                               may have integers as values, it is not considered a numeric attribute because the inte-
                               gers are not meant to be used quantitatively. We will say more on numeric attributes in
                               Section 2.1.5.
                                 Because nominal attribute values do not have any meaningful order about them and
                               are not quantitative, it makes no sense to find the mean (average) value or median
                               (middle) value for such an attribute, given a set of objects. One thing that is of inter-
                               est, however, is the attribute’s most commonly occurring value. This value, known as
                               the mode, is one of the measures of central tendency. You will learn about measures of
                               central tendency in Section 2.2.

                         2.1.3 Binary Attributes

                               A binary attribute is a nominal attribute with only two categories or states: 0 or 1, where
                               0 typically means that the attribute is absent, and 1 means that it is present. Binary
                               attributes are referred to as Boolean if the two states correspond to true and false.

                  Example 2.2 Binary attributes. Given the attribute smoker describing a patient object, 1 indicates
                               that the patient smokes, while 0 indicates that the patient does not. Similarly, suppose
   73   74   75   76   77   78   79   80   81   82   83