2012-05-23 70 views
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 

回答

1

它有点分不清哪些代码是由于包装,但可以将其简化这样做 = repeatA ASS1 ass2 ass3。 (A)A =平均(屁股,贝司,草,气)。 结束重复。

如果所有值都丢失,mean将自动返回sysmis。 如果你想要求一定数量的非缺失值,比如说2, ,如果缺失(A)A = mean.2(屁股,贝司,草,气),你可以将该语句写成 。

HTH, Jon Peck