How can I loop through variables in SPSS? I want to avoid code duplication.
Posted
by chucknelson
on Stack Overflow
See other posts from Stack Overflow
or by chucknelson
Published on 2010-05-21T18:12:54Z
Indexed on
2010/05/21
18:20 UTC
Read the original article
Hit count: 359
Is there a "native" SPSS way to loop through some variable names? All I want to do is take a list of variables (that I define) and run the same procedure for them:
pseudo-code - not really a good example, but gets the point across...
for i in varlist['a','b','c']
do
FREQUENCIES VARIABLES=varlist[i] / ORDER=ANALYSIS.
end
I've noticed that people seem to just use R or Python SPSS plugins to achieve this basic array functionality, but I don't know how soon I can get those configured (if ever) on my installation of SPSS.
SPSS has to have some native way to do this...right?
© Stack Overflow or respective owner