English 中文(简体)
SPSS 合并计算和计算
原标题:SPSS combine count and compute
  • 时间:2012-05-26 13:50:29
  •  标签:
  • spss

Is something like this possible in spss? COMPUTE new_var = (COUNT var1 to var5 (1))*2 + (COUNT var1 to var5 (2))*3

最佳回答

由我自己找到一个解决方案:

COMPUTE myindex= 0.
DO REPEAT v=var1 TO var5.
   DO IF v=1.
      COMPUTE myindex= myindex+2.
   END IF.
   DO IF v=2.
      COMPUTE myindex= myindex+3.
   END IF.
END REPEAT.
问题回答

未经测试的语法 。

RECODE var1 to var5 (1 = 2) (2 = 3) (else = 0) into tmp1 to tmp5.
COMPUTE new_var = sum(tmp1 to tmp5).




相关问题
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 ...

热门标签