cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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".

Recommended Articles