Scoring a subset in SPSS?


I'm trying to apply an existing XML model to my SPSS dataset. However, I only want to apply the model to a subset of my data -- is it possible to create some kind of "filter" or "selection variable" ... so that the regression will only be applied to a subset of the data?

For instance, I have a data set about animals and their various attributes. I only want the model to be applied to the data where animals = "elephant". Is it possible to specify a filter like this? Or do I have to import a data subset manually?

You can do this through the GUI (Data -> Select Cases) but the basic syntax is:

comp flag = animals eq "elephant".
filter by flag.
Hi helicon,

Thanks! But is there another way to do it other than to create this kind of "select case" method? I have maybe 10 different subsets to run and it might be kind of challenging to do that ten times -- as in, is there some way to say "regression subset = animal = elephant" ? Or can it only be done through a select case?

Last edited:
Thank you Helicon! That helps... so I guess there's no way to run a different model on each subset of the data -- is there? So for instance... where animal = elephant, run model E. Where animal = dog, run model D. etc.... ?