生成空单元格的平均值

时间:2012-05-23 21:00:41

标签: spss

我是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

1 个答案:

答案 0 :(得分:1)

有点难以分辨出包装的代码是什么,但你可以像这样简化它 do repeatA = ass1 ass2 ass3。 如果缺少(A)A =平均值(驴,鲈鱼,草,气)。 结束重复。

如果缺少所有值,则mean将自动返回sysmis。 如果你想要一定数量的非缺失值,比如2, 你可以把声明写成 如果遗漏(A)A = mean.2(驴,鲈鱼,草,气)。

HTH, 乔恩佩克