Recode Numeric Values to Categories |
How To... > Work with Formulas > Work with the Formula Editor > Recode Numeric Values to Categories Much data come with categories coded numerically rather than as words. But when you’re doing data analysis with Fathom, you want the categories to be words you can read, not numbers you have to keep translating. Recoding is done with the switch function, which is a conditional function that acts like a complicated if-statement. The collection here has two numerically coded attributes: sex: 1 = "Female", 2 = "Male"; education: 1 = "High School", 2 = "College No Degree", 3 = "College Degree", 4 = "Graduate Work"
Tab to move in the switch function. To insert the second option, press Insert, or Ctrl+Enter (Win) Option+Enter (Mac). You should include the “Other” value in the formula so that wrongly entered data and missing values don’t get coded as male.
Here are the results, shown in a case table:
You could now clear the recoding formulas and even delete the original attributes. |