I have 60 variables (selected = 1, not selected = 0 VAR1 to VAR60) that I wanted to collapse into one variable with 60 keys (MAINVAR). However, each one of my ids, could have more than 1 selected. If I did a simple if then, it overwrites. What is the most effective way of doing this? It would then become a stacked file. Each id that has more than one variable selected would have multiple entries. To make it a little bit more complex, for each selected there is a corresponding date var and also corresponding timing variable (past present selected not selected). However, I could do the same thing for the timing and the date variables, once I know how to do this (I think). Example of what the datafile looks like now (leaving dates and timing out): ID VAR1 VAR2 VAR3 VAR4 VAR5 VAR6 etc… A 1 0 1 1 0 0 B 0 1 0 0 0 0 C 1 1 1 1 0 0 D 0 0 0 1 1 1 Example of how it would be from the example above: ID MAINVAR (keys 1-60) A 1 A 3 A 4 B 2 C 1 C 2 C 3 C 4 D 4 D 5 D 6 Thank you!
... View more