Search code examples
spss

Combine variables by adding rows


I have different columns of contentious variables and each column represents a category. I would like to combine all columns into a single column by adding the appropriate number of rows and create a new column for the category name of each row using spss or excel.

This is what my data looks like now:
enter image description here

This is what I want to have:
enter image description here


Solution

  • This is a simple restructure, use varstocases like this:

    varstocases make value  from A B C/index=category(value).