Scoring a subset in SPSS?

#1
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!
 
#2
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.
 
#3
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:
#5
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.... ?