Categorical Variables 

Data Tables

You probably remember "mean," "median," and "mode" from high school, but it doesn't make sense to apply many of these mathematical principles to qualitative or categorical variables. 


Consider the example below

Data Frame

The data frame above displays eye color - a qualitative variable - as a string and as a numeric value (1=blue; 2=brown; etc). 

Data Table (one-way)

As shown in the table above, 5 students have brown eyes, corresponding to a code of "2" on the numeric scale for eye color. 

Does this make sense?

 You can identify categorical variables by asking if the math makes sense; therefore, you must use your everyday brain before applying math to categorical variables!

We could, for example, calculate the mean of eye color and get 2.2. Yet, it doesn't make sense