Using Categorical Data

Categorical data refers to data which is coded to represent some group. The numbers used to code the data are usually arbitrary and thus statistics that use the values of these numbers in calculations, like correlation, would not be appropriate. For example, suppose we wanted to add the sex of the student. We could code 1 as male, and 2 as female. We could enter a new column containing the data like this:

MTB> SET C7


DATA> 1 2 2 1 1 1 1 2 2 2 2 1 1 1 1 1 2 1 2 2


DATA> END

 

It is possible to have more than 2 categories. For example, the class the student is in might have four categories: 1= freshman, 2=sophomore, 3=junior, and 4=senior. To enter this data, type:

MTB> SET C8


DATA> 4 4 1 1 3 1 2 1 3 4 2 2 1 1 1 1 2 1 3 4


DATA> END

 

Then we could add labels to our new data. Type:

MTB> NAME C7 'SEX' C8 'CLASS'

Your rating: None Average: 1 (2 votes)