我第一次尝试在 SAS 中使用非常大的数据集(约 150 万行),但遇到了一些困难。我拥有的数据集被格式化为“长”.txt 文件,如下所示:
'cat1/: Topic1_Variable1'
'cat2/: Topic1_Variable2'
'cat3/: Topic1_Variable3'
'cat4/: Topic1_Variable4'
'cat1/: Topic2_Variable1'
'cat2/: Topic2_Variable2'
'cat3/: Topic2_Variable3'
'cat4/: Topic2_Variable4'
'cat1/: Topic3_Variable1'
'cat2/: Topic3_Variable2'
'cat3/: Topic3_Variable3'
'cat4/: Topic3_Variable4'
...
为了分析和分享给别人,我真的很想看到它的格式如下:
cat1 cat2 cat3 cat4
Topic1_Variable1 Topic1_Variable2 Topic1_Variable3 Topic1_Variable4
Topic2_Variable1 Topic2_Variable2 Topic2_Variable3 Topic2_Variable4
Topic3_Variable1 Topic3_Variable2 Topic3_Variable3 Topic3_Variable4
我认为这在 R 中可能更容易,但老实说,我在 SAS 中完全空白。我什至玩过 MS Access 试图让它看起来像我想要的那样,但程序每次都会崩溃(由于大小?)。无论如何,我已经研究了 PROC TRANSPOSE 和 PROC SQL 中的一些语句,但似乎这些过程中的大多数函数都用于组合重复的“主题”。在我提供的数据中,每个“组”代表一个对数千个人重复的问题的个人回答,我想保留每次出现的独立性,而不是执行 PROC SQL 中定义的 UNION。在这一点上,我觉得我想得太多了,但我就是无法绕过心理障碍,真正去做我正在努力的事情。非常感谢任何帮助或指导。一世'