Solution

The first task is to identify the highest and lowest values of mpg in the data set. One way to do so is to sort the data by mpg and then look at the first and last observations:

sort mpg
l make mpg in 1
l make mpg in -1

This tells us the lowest value is of mpg 12 and the highest is 41.

Next, create the value label map:

label define mpgLabel 12 "12 (Lowest MPG)" 41 "41 (Highest MPG)"

Now apply that mapping to the values of the mpg variable:

label values mpg mpgLabel

Do a list to see the results:

l make mpg

Last Revised: 11/23/2009