Sometimes you have a dataset that has a value you need to count. Let’s say you have a file with 7,000 student records. Each case has a variable called ‘Section’ that contains numerical codes indicating which section a student was registered in. You need to know the headcount in each section. You could run a frequency command on the section variable and simply count the number of sections but you like to do things in a more elegant way. Use SPSS’s AGGREGATE function. You can do it syntax or using the menu interface.
Note: At these prices I haven’t upgraded since version 16. I keep wishing they’ll make the graphing features easier to use but I’ve given up hope on that one and will be holding on to my $1500 thank you very much. Are you listening IBM?
Here’s the syntax:
/OUTFILE=’C:\Documents and Settings\Eric Graig\My Documents\aggr.sav’
SPSS will generate a new file called aggr.sav in the default folder (or whatever folder you specify) which will look like this:
Here’s what the data looked like in the original file:
If syntax isn’t your forte, you can access the aggregate function area using the GUI. This dialog is under the data menu. Look for ‘Aggregate’:
For simple counts, not such a big deal. But let’s suppose you need to know the average grade in each section (you’re doing a study to see if some professors are particularly hard graders, or these days, it’s more likely you’re interested in flagging the easy graders). Simply click the function box and select the average function.
Learn something new everyday! BTW, you can double click the thumbnails to see the dialog boxes more clearly.