语法命令在列中更改特定值

发布于 2025-02-12 19:33:58 字数 170 浏览 0 评论 0原文

我进行了一些研究,并给了我的受访者“其他”的选项,他们可以在其中指定他们从何处提供我作为选择的那些类别。此“其他”类别已被编码为“ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界等同你 2025-02-19 19:33:58

如果您的变量为var1;您可以在语法窗口中编写和运行:

recode var1 (6=2).
execute.

这将用2替换Var1中的所有6个。

您还可以创建一个新的var2,因此确保您不覆盖原始var1:

recode var1 (6=2) (else=copy) into var2.
execute.

您可能只想为受访者做这件事已经确定没有正确阅读所有答案。 您可能需要创建一个附加变量:

misread

如果要将6更改为2,则使用值1,如果要保留6。

然后,

do if  (misread = 1).
recode var1 (6=2) (else=copy) into var2.
end if.

if your variable is var1; you can write and run in a syntax window:

recode var1 (6=2).
execute.

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:

recode var1 (6=2) (else=copy) into var2.
execute.

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:

misread

with values 1 if you want to change 6 into 2, and 0 if you want to keep 6.

Your code is, then:

do if  (misread = 1).
recode var1 (6=2) (else=copy) into var2.
end if.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文