语法命令在列中更改特定值
我进行了一些研究,并给了我的受访者“其他”的选项,他们可以在其中指定他们从何处提供我作为选择的那些类别。此“其他”类别已被编码为“ 6”类别。但是,有些人并没有很好地阅读现有类别,并从本质上写下了给他们的选择。如何在数据集中更改它?因此,在使用SPSS语法时,将特定值“ 6”更改为“ 2”?我尝试到处寻找,但我找不到答案:(
I did a little research and gave my respondents the option "other" where they could specify where they're from if not from those categories that I gave them as options. This "other" category has been coded as category "6". But some people didn't read the existing categories well and wrote essentially what was given to them as an option. How can I change this in the dataset? So change a specific value "6" to "2" while using SPSS syntax? I tried looking everywhere but I haven't been able to find an answer :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的变量为var1;您可以在语法窗口中编写和运行:
这将用2替换Var1中的所有6个。
您还可以创建一个新的var2,因此确保您不覆盖原始var1:
您可能只想为受访者做这件事已经确定没有正确阅读所有答案。 您可能需要创建一个附加变量:
如果要将6更改为2,则使用值1,如果要保留6。
然后,
if your variable is var1; you can write and run in a syntax window:
This will replace all 6 in var1 with a 2.
You can also create a new var2, hence making sure you are not overwriting your original var1:
You might want to do this only for respondents you have identified as not having read all the answers correctly. Then you might want to create an additional variable:
with values 1 if you want to change 6 into 2, and 0 if you want to keep 6.
Your code is, then: