2017-03-17 2 views
2

내가 가진 데이터 :SPSS - 경우에 변수 같은

:이 같은 구조 조정 (경우에 바르?) 사람이 있었다 과일의 각 번호에 대해 하나 개의 레코드를 반환 할 필요

Person Region Grapes Apples Bananas 
Bob IV  4  2  1 
Jane II  0  1  2 

Person Region Fruit 
Bob IV  Grapes 
Bob IV  Grapes 
Bob IV  Grapes 
Bob IV  Grapes 
Bob IV  Apples 
Bob IV  Apples 
Bob IV  Bananas 
Jane II  Apples 
Jane II  Bananas 
Jane II  Bananas 

아래 코드는 걸음 더 가까이 아니지만 꽤 존재하는이를 반환합니다

Person Region Fruit Count 
Bob IV  Grapes 4 
Bob IV  Apples 2 
Bob IV  Bananas 1 
Jane II  Apples 1 
Jane II  Bananas 2 

VARSTOCASES /MAKE Count FROM Grapes Apples Bananas /INDEX=Fruit(Count) /KEEP=Person Region /NULL=KEEP.

제안 사항?

답변

2

예, 코드의 첫 단계입니다. 그것을 것입니다 루프를 통해 당신의 Count 변수에 따라 값을 반복 - 당신이 필요로하는 모든 사용자들은

loop # = 1 to Count. 
xsave outfile = 'c:/personal/disaggregated.sav'/drop count. 
end loop. 

: 다음, 그냥이 부분을 추가합니다.

건배, 발레리아