English 中文(简体)
生成空单元格的平均值
原标题:generating mean values to empty cells
  • 时间: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.

这里出问题了 。 我理解屁股1, 屁股2, 屁股3 是指单元格( 列屁股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
问题回答

Its a little hard to tell what the code is due to the wrapping, but you can simplify it like this do repeatA = ass1 ass2 ass3. if missing(A) A = mean(ass, bass, grass, gas). end repeat.

If all the values are missing, mean will return sysmis automatically. If you want to require a certain number of nonmissing values, say, 2, you could write the statement as if missing(A) A = mean.2(ass, bass, grass, gas).

HTH, Jon Peck





相关问题
SPSS Python Error

Getting the following error when trying to run SPSS from an external Python IDE. import spss yields the following error Traceback (most recent call last): File "C:Documents and SettingsUSER...

SPSS Set Page breaks in Syntax

Is it possible to set page breaks using syntax for the Output viewer? I am looking for ways to programmatically control the content in the output window; everything seems to be done by pointing and ...

Exact binomial test in SAS or SPSS?

I have 400,000 rows, each with an id, number of trials, and number of successes. I have (one) value for p, a hypothesized probability of success. I d like to calculate an exact, binomial, one-sided ...

linking info of pairs of respondents (couples) in SPSS

I am preparing for analyses of the determinants of partner choice in SPSS, but basically I can t get off the ground because I don t know how to create new variables based on the information of each ...

Specifying relative paths in SPSS 18

In SPSS 11 it was possible to specify relative paths. Example: FILE HANDLE myfile= ....datacurrent.txt /LRECL=533. DATA LIST FILE=myfile / ... This worked because apparently, SPSS 11 set the ...

SPSS and PHP/MySQL Integration

I apologize up front for the broadness of this question, but I m wondering if anyone has any suggestions/pointers. A friend s company uses SPSS for statistical data, surveys, etc. They d like to be ...

热门标签