Transforming multiple single choice column into multi choice column-setsHello,
I have the following data arrangement:
Three columns with codes and labels which have the same contents, e.g. 1=Washington, 2=New York, 3=San Francisco,...
Washington could be chosen in two or three columns.
I now want to rearrange it as it would be a multi code variable: One column for Washington, one for New York etc, each with codes 1 (for selected) and 0 (for not selected).
Is there any easy solution to this?
Thank you very much.
Re: Transforming multiple single choice column into multi choice column-setsWo, thank you very much for the quick response and you effort.
This solves the problem. I tried stacking and splitting, but did not get the result. With this approach (esp. step 3 and 4), it works perfectly.
Thanks
Re: Transforming multiple single choice column into multi choice column-setsThis is not very complex, but it takes a few steps to do this interactively
- Assuming your data looks like this:
- Stack the data by going to Tables==>Stack and placing into the Stack Column selection box, your 3 Choice columns. It will create a data table that looks like:

- The Label column needs to have all of its values changed to 1, so select the Label column, click on the red triangle in the column panel, and select Recode

- Change all 3 values of Choice 1, Choice 2 and Choice 3 to have the value 1 and click Recode. You will get a data table that looks like :

- Now the table needs to be Split back into columns, so go to Tables==>Split and set up the dialog box as shown below

- Here is the resulting table:

- Now the blanks need to be filled in with zeros "0". To do this, a simple cut and paste can be used. The first thing is to go to any one of the blank cells and type in the number 0.
- Copy the contents of that cell into the paste buffer by selecting it, and using CNTL/C to copy it.
- Now go to the Washington column and right click on any one of blank cells, and select, Select Matching Cells.
- While keeping the cursor in the column use CNTL/V to paste the saved "0" into all of the selected cells.
- Repeat the above 2 steps(9,10) for the New York and San Francisco columns.
- Here is the final table
