cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
jmpuser1234
Level I

How do I recode indicator columns into one nominal (or ordinal) column?


I have a data set that has been created with indicator columns for all nominal and ordinal variables (for the purpose of running a regression model). For instance, the variable "Marital Status" has 3 possible values, Single, Married, Divorced. The current data file has two columns for this one variable. A "1" in column one and a "0" in column two indicates "Single", a "0" in column one and a "1" in column two indicates "Married" and a "0" in both columns represents "Divorced". I am using JMP and I would like to create one column for this variable with the values of "Single", "Married", or "Divorced". How do I do that? Would it be different for ordinal data?

1 REPLY 1
pmroz
Super User

Re: How do I recode indicator columns into one nominal (or ordinal) column?

Create a third column called Marital Status.  Right click on the column header and select Column Info.  Click on Column Properties and select Formula.  Click on Edit Formula.  Double-click inside the red rectangle and enter the following code:

If (

      :Column 1 == 1 & :Column 2 == 0, "Single",

      :Column 1 == 0 & :Column 2 == 1, "Married",

      :Column 1 == 1 & :Column 2 == 1, "Divorced"

)


This assumes that your first two columns are called "Column 1" and "Column 2".