Hello,
I was wondering if it is possible to rename groups of variables using the foreach command or similar.
I have been provided questionnaire data where the variable names include the question stem like this:
.......
I would quite like to rename my variables along the lines of...
mentalhealth_1
mentalhealth_2
mentalhealth_3
........
mentalhealth_50
Is this possible and how would I go about doing this?
Many thanks for any advice.
I was wondering if it is possible to rename groups of variables using the foreach command or similar.
I have been provided questionnaire data where the variable names include the question stem like this:
A1howoftendoyoufeelsad
A2howoftendoyoufeelanx
A3howoftendoyoufeelstres
A2howoftendoyoufeelanx
A3howoftendoyoufeelstres
A50howoftendoyoufeelguilt
mentalhealth_1
mentalhealth_2
mentalhealth_3
........
mentalhealth_50
Is this possible and how would I go about doing this?
Many thanks for any advice.
Comment