1

我是 SPSS 新手,我正在尝试为空单元格生成平均值(基本上通过用户给出的平均答案填写缺失的信息),我无法让我的示例代码工作(或很好地理解示例)。

COMPUTE QOL_puutt = Nmiss(ass, bass, grass, gas).

这部分我明白

Do repeat A  = ass1 ass2  ass3. If ((Missing (A)) & QOL_puutt <= 4) A
= RND(Mean (ass1, ass2, ass3)).  End repeat.

这里出了点问题。我知道 ass1,ass2,ass3 是指单元格(第 3 列)???以下是错误代码

Error # 4285 in column 15. Text: ass1 Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command. Execution of this command stops.

Error # 4285 in column 15. Text: ass2 Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command. Execution of this command stops.

Error # 4285 in column 15. Text: ass3 Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command. Execution of this command stops
4

1 回答 1

1

由于包装,很难说出代码是什么,但您可以像这样简化它 do repeatA = ass1 ass2 ass3. 如果缺少(A)A = 平均值(屁股,低音,草,气)。结束重复。

如果缺少所有值,mean 将自动返回 sysmis。如果您想要求一定数量的非缺失值,例如 2,您可以将语句编写为缺少(A)A = mean.2(ass, bass, Grass, gas)。

HTH,乔恩·派克

于 2012-05-24T03:12:44.123 回答