gpt4 book ai didi

syntax-error - SPSS : Adding two variables using DO REPEAT

转载 作者:行者123 更新时间:2023-12-03 08:02:30 26 4
gpt4 key购买 nike

我是SPSS的新手,它是统计 Realm 的专家,也是本论坛的新手。我正在与我的硕士学位一起进行研究,遇到了一些问题并寻求帮助。是的,我可以聘请顾问,但是请查看学习过程的这一部分,并希望了解我是否无法掌握这一点-当然需要您的帮助。

我想添加:q1和q51 q2和q52 q3和q53等....到q50和q100

当前新的变量名是TOTAL1到TOTAL50,但可以是任何值。 Q1至q100存在且连续TOTAL1至TOTAL 50存在且连续

我试过了:

do repeat x = q1 to q50 
/y = q51 to q100
/z = TOTAL1 to TOTAL50.
COMPUTE z = x + y.
end repeat .
EXECUTE.

但是在输出中得到以下内容:

Error # 4502 in column 11. Text: = An equals sign appears in a variable or value list where it is not expected. It will be ignored. Execution of this command stops.

Error # 4508 in column 15. Text: + Unrecognized text appears on the DO REPEAT command. It will be ignored. EXECUTE. do repeat x = q1 to q50 / y = q51 to q100 / z = TOTAL1 to TOTAL50 COMPUTE z = x + y end repeat .

Error # 4502 in column 11. Text: = An equals sign appears in a variable or value list where it is not expected. It will be ignored. Execution of this command stops.

Error # 4508 in column 15. Text: + Unrecognized text appears on the DO REPEAT command. It will be ignored. EXECUTE.



这是最好的方法吗?谁能发现语法错误?

我正在使用SPSS v.20。

最佳答案

尝试这个

do repeat x = q1 to q50 
/y = q51 to q100
/z = TOTAL1 to TOTAL50.
- COMPUTE z = x + y. /*i just added a minus sign before the compute./
end repeat .
EXECUTE.

关于syntax-error - SPSS : Adding two variables using DO REPEAT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30011574/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com