答案 0 :(得分:0)
以下解决方案假设数据有5个二分变量 - 每个变量类别各有一个。
* creating some sample data to demonstrate on.
data list list/cat1 to cat5.
begin data
1 0 0 0 1
0 1 1 0 0
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 0 1
1 0 0 0 0
1 1 1 0 0
end data.
* now checking in which cases only category 1 was chosen.
compute NumCats=sum(cat1 to cat5).
if cat1=1 and NumCats=1 onlyCat1=1.
execute.
* if instead you wish to do the same check for each of the 5 categories,
use `do repeat` this way.
do repeat cat=cat1 to cat5/only=only1 to only5.
compute only=(cat=1 and NumCats=1).
end repeat.
execute.
答案 1 :(得分:0)
但是抛弃了EXECUTE命令。在这种情况下,它们只会导致无用的数据传递,除非立即更新数据编辑器(而不是在下一次数据传递时更新)。