2
votes

I think I have a pretty easy question that I can't find the answer to. I have divided my data into two different groups designated as 1 or 2. If I would like to run a frequency for another variable on just the 1, how do I do that?

For example, all my 1's are people from the United States, and 2's are international. Another variable is what age group they are in. How do I see the ages for just those who are 1's?

Thanks very much!

1

1 Answers

4
votes

If you just want to run the frequencies for one particular group, you can use a TEMPORARY. and then a SELECT IF command. Something like this.

TEMPORARY.
SELECT IF Group = 1.
FREQ VAR = MyVar.

This is convenient for one group, but for multiple groups I would suggest you examine the SPLIT FILE command, which will generate subsets of tables for each distinct group. Something like:

SORT CASES BY AgeGroup.
SPLIT FILE BY AgeGroup.
FREQ VAR = MyVar.
SPLIT FILE OFF.

This will generate a set of frequency tables for MyVar for each of the distinct groups in the AgeGroup variables.