Repeating GPL structure?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Repeating GPL structure?

Robert L
Every now and then, I have come across tasks where there is a lot of repetition, for example when a long series of boxplots should be created. Using Chart Builder syntax is often the best choice since it can be more fine-tuned (at least as far I have seen so far). But it is quite tedious to repeat the GPL syntax for every boxplot. What would the best way be to "loop" through a number of such boxplots? I would like to have the possibility to have separate titles along with the different variables, and perhaps even separate extra lines for comparison. Would it be possible to set up a list of the following kind:

*var1.
var1_title 'The distribution of A'.
var1_complevel 23.

*var2.
var2_title 'The distribution of B'.
var2_complevel 28.

*Followed by a GPL sequence for a boxplot calling the input for each variable in turn, setting the titles and comparison lines.

Since my SPSS programming skills are fairly limited, it seems as if this could be a neat way to explore the tools available. Macros, scripts or Python? Suggestions and hints are very welcome.

Robert

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Robert Lundqvist
Reply | Threaded
Open this post in threaded view
|

Re: Repeating GPL structure?

Andy W
Ruben posted an answer on Stackoverflow with an example in Python here, http://stackoverflow.com/a/13825642/604456.

Also I have suggested to reshape the data from wide to long (so all variables of interest are in one column) and then use split file. It isn't as flexible as going for python though. You can see one example in that same stackoverflow question, or I provide another one to this question on developerworks, https://www.ibm.com/developerworks/community/forums/html/topic?id=db66a899-e0d1-44b7-a151-da6dbd79bff3&ps=25

You will have to be more specific to get any more specific advice.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/