如何在 SPSS and/or excel 中将多列数据合并为两列?

how to merge multiple column data into two columns in SPSS and/or excel?

我正在学习 SPSS 和 excel 中的数据输入。比如我下面有500列的数据格式:

plant1  plant2  plant3  …   plant500
-0.32   -0.01   -0.28   …   …
-0.40   0.14    -0.19   …   …
-0.43   -0.19   -0.29   …   …
-0.48   -0.16   -0.04   …   …

我想将其更改为以下格式:

plant1   -0.32 
plant1   -0.40 
plant1   -0.43 
plant1   -0.48 
plant2   -0.01 
plant2   0.14 
plant2  -0.19 
plant2  -0.16 
plant3  -0.28 
plant3  -0.19 
plant3  -0.29 
plant3  -0.04 
…           …
plant500    …
plant500    …
plant500    …
plant500    …

你能帮我看看怎么做吗

谢谢

在 SPSS 中,假设您的 plant1plant500 变量是连续的,下面的语法就可以解决问题; (如果你的变量不是连续的,就得一一指定)。

VARSTOCASES /MAKE reading from plant1 to plant500 /INDEX=PLANT_NR (reading). EXECUTE.

这里有更多关于 VARSTOCASES 命令的内容: https://www.ibm.com/support/knowledgecenter/en/SSLVMB_23.0.0/spss/base/syn_varstocases_variable_name_index.html