# Scoring a subset in SPSS?

#### mikeyonaboat

##### New Member
Hi!

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?

Thanks!

#### helicon

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

Code:
comp flag = animals eq "elephant".
filter by flag.
exe.

#### mikeyonaboat

##### New Member
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?

Thanks!

Last edited:

#### helicon

##### Member
See the Split File command (Data -> Split File) and either 'Compare Groups' or 'Organize outputs by group'.

#### mikeyonaboat

##### New Member
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.... ?