Search code examples
macrosspss

Assigning same variable label for range of variables in SPSS


I'm trying to assign the same variable label to a range of variables, ie.

VARIABLE LABELS
Q1 "Magneto"
Q2 TO Q5 "Rogue"
Q6 "Wolverine"
Q7 TO Q10 "Gambit".

Unfortunately, when I open the SPSS file, I find Q2 has been labelled 'TO Q5 "Rogue"', and Q3, Q4, and Q5 have no variable labels (same case with Q7, label is 'TO Q10 "Gambit"'). Please help me understand where I'm going wrong, and thank you so much for your time.


Solution

  • You can use Q2 TO Q5 for value labels but apparently not for variable labels. I guess the programmers didn't think anyone would wish to give the same label to different variables.
    If you are doing that in order to group variables (e.g by using spssinc select variables) you can use a feature which is made for that especially, by defining custom variable attributes, and using them to group the variables (while not losing the ability to define individual labels for each variable).