我可以在 SPSS 中全局修复值/标签对吗
叹。我拥有这个令人难以置信的数据集,其中包含近 15,000 个有效案例。只有一个问题。我的网络调查配置为自动传递每个 Likert 变量的唯一数值。而且,由于调查多次分支,我最终得到了一百多个标量变量,如下所示:
SampleLikertVariable。数字。 10355 =“强烈不同意。” 10356 =“有些不同意。” 10357 =“中立”。 10358 =“有点同意。” 10359 =“强烈同意。”
遗憾的是,每个变量都有与量表的五个点相关的不同数值范围。在组合变量之前,我需要将数据恢复为 1,2,3,4,5。理想情况下,我希望保持标签完好无损,尽管如果我丢失它们也不是世界末日。该过程需要通过语法脚本实现自动化。
到目前为止,我能想到的唯一方法是使用 IF 语句块,如下所示:
IF (MISSING(ywNfMotivationsPvp)=1) ywNfMotivationsPvp=0.
IF ywNfMotivationsPvp=10277 ywNfMotivationsPvp=1.
IF ywNfMotivationsPvp=10278 ywNfMotivationsPvp=2.
IF ywNfMotivationsPvp=10279 ywNfMotivationsPvp=3.
IF ywNfMotivationsPvp=10280 ywNfMotivationsPvp=4.
IF ywNfMotivationsPvp=10281 ywNfMotivationsPvp=5.
但我们正在讨论数百个需要进行相同处理的变量。必须有更好的方法。
我考虑创建一个基本的 FOR 循环来减少一些重复,但这仍然需要我手动记下每个变量编号的唯一起始编号。我考虑过将变量名和唯一的起始数字存储在配对数组中,但在挖掘文档并弄清楚如何在 SPSS 语法中执行此操作之前,我想我会问一个简单的问题:
是否有更好的或更简单的方法吗?
Sigh. I've got this fabulous data set with close to 15,000 valid cases. There is just one problem. My web survey was configured to automatically pass unique numeric values for each Likert variable. And, because the survey branched multiple times, I'm ending up with more than a hundred scalar variables such as the following:
SampleLikertVariable. Numeric. 10355 = "Strongly disagree." 10356 = "Somewhat disagree." 10357 = "Neutral." 10358 = "Somewhat agree." 10359 = "Strongly agree."
Sadly, each variable has a different numeric range associated with the five points of the scale. Before I can combine variables, I need to restore the data to 1,2,3,4,5. Ideally, I would like to keep the labels intact, though it's not the end of the world if I lose them. The process needs to be automated through syntax scripts.
So far, the only way I can think of to do this is a block of IF statements such as these:
IF (MISSING(ywNfMotivationsPvp)=1) ywNfMotivationsPvp=0.
IF ywNfMotivationsPvp=10277 ywNfMotivationsPvp=1.
IF ywNfMotivationsPvp=10278 ywNfMotivationsPvp=2.
IF ywNfMotivationsPvp=10279 ywNfMotivationsPvp=3.
IF ywNfMotivationsPvp=10280 ywNfMotivationsPvp=4.
IF ywNfMotivationsPvp=10281 ywNfMotivationsPvp=5.
But we're talking hundreds of variables that will need to get this same sort of treatment. There has got to be a better way.
I considered creating a basic FOR loop that would reduce some of the repetition, but this would still require me to manually jot down the unique starting number for each variable number. I've considered storing the variable names and unique starting numbers in a paired array, but before mining the documentation and figuring out how to do this in SPSS syntax, I figured I would ask one simple question:
Is there a better or easier way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我已经弄清楚如何使用
AUTO RECODE \INTO
来做到这一点。它并不是完全无痛,但比我上面描述的要顺利得多。I think I have figured out how to do this with
AUTO RECODE \INTO
. It isn't completely painless, but much smoother than what I described above.好的解决方案。这也可以通过计算
ALL
或V1 到 v99
或类似的东西的最小值并从每个变量中减去它来完成。 DO REPEAT 在这里可以工作。AGGREGATE
或OMS
可以帮助您批量执行此操作。使用 autorecode 需要注意一件事:如果任何问题没有具有特定值的答案,它将被折叠起来,并且较高的值会向下移动。执行
自动重新编码
后,您可以通过将所有变量的最大值制成表格来进行检查。Good solution. This could also be done by calculating the minimum for
ALL
orV1 to v99
or something like that and subtracting that from each variable. DO REPEAT would work here.AGGREGATE
orOMS
could help you do this in bulk.One thing to watch out for with
autorecode
: If any question has no answers that have a particular value, it will get collapsed out and higher values moved down. You can check by tabulating the maximums for all the variables after you doautorecode
.