Question

In SPSS I have a data in columns:

q1 q2 q3 q4 q5 q6 q7 q8

Q1 is a question 1, q2 is... Each of the fields in those columns can take only one of following values (all labeled): 1 which is no 2 which is sometimes 3 which is yes

In variable view it looks like this: {1, no} {2, sometimes} {3, yes}

I would like to get information, how many yes/sometimes/no in total did I get, how could I do that? Thank you in advance for your help, much appreciated :)

Was it helpful?

Solution

You can do this simply by using VARSTOCASES. You can use the Restructure wizard under Data or just syntax like this (be sure that your original dataset is saved first):

varstocases
/make allquestions from Q1 to Q8.

Then run FREQUENCIES on the new variable allquestions.

OTHER TIPS

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

What you are describing is called a frequency table, which shows the frequency at which all (observed) values were observed.

To get it in SPSS, go in Analyze > Descriptive Statistics > Frequencies, then put your variable in the list called Variable(s). Make sure that the option Display frequency tables is checked. There are also other statistics, options, and graphs (e.g. histogram of your data, with or without normal curve superimposed) that you can get from this window as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top