@Mateusz Chrzaszcz: first and foremost, try to get into the habit of working from syntax.
It seems to me you're looking for COUNT
. Do not confuse this with AGGREGATE. The big difference is that COUNT
counts over columns and AGGREGATE
counts over rows.
Now try and copy-paste-run the following syntax without any data open:
*Create test data.
data list free/id.
begin data
1 2 3 4 5 6 7 8 9 10
end data.
do repeat q = q1 to q8.
compute q = tru(rv.uni(1,4)).
end repeat.
exe.
value labels q1 to q8 1 'Yes' 2 'Sometimes' 3 'No'.
*Now check out the data. It should be pretty similar to what you have.
*Next, we'll count how many times each respondent ("row") answered "Yes" on q1 to q8.
count no_yes = q1 to q8(1).
*Check frequency table with bar chart.
freq no_yes
/barchart freq.