Tips – Syntax with define variable group
I got a question from someone that repeated a lot of commands with a large number of variables (he had about 50!), and he asked me if there was a way to define this as a group, and the answer is “Yes”.
You use the DEFINE and ENDDEFINE! commands in syntax. Here is my example where I create a group of variables that I name “myvariables”:
Then you can call this group called “myvariables” like in this simple frequency command:
And as I have 4 variables (gender, jobcat, minority and educ) in this Group, I will get 4 frequency tables:
If you then continue with a lot of other analysis where you want to use the same variables like in this crosstables command:
If you want to read more about this and other syntax like looping you have a help link here:
Have a great week!