2012-05-26 88 views
0

在spss中可能會出現這種情況嗎? COMPUTE new_var =(COUNT VAR1到VAR5(1))* 2 +(COUNT VAR1到VAR5(2))* 3SPSS結合計數和計算

回答

0

獨自找到一個解決方案:

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. 
0

未測試的語法。

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