Stata and Stata Forum Beginner here.
Situation: Using Limesurvey data for a health-related QOL study. This has questions where the responses range from things like 'none of the time' to 'all of the time'. These are coded A1 to A5 respectively by Limesurvey.
Exporting the responses often results in strings (with non-numerical characters) where I would want numerical values as a code. So I searched up the encoding command. (the alternative would be to use global find and replace on excel but I want to find a way to do this on Stata, so I can instantly transform any new responses appropriately using a do file).
Problem: Encoding option encodes from A1 to A5 as 1 to 5 but I'd rather it start from 0.
Question: Is there a way to exactly tell Stata how to encode such responses? Or a better way to assign numerical codes to the string answers from the survey rather than encode? I'm aware that maybe my only option is to generate a new variable using if and replace but that seems inelegant and Id have to repeat it many many times for all of the questions.
Any help would be greatly appreciated.
Situation: Using Limesurvey data for a health-related QOL study. This has questions where the responses range from things like 'none of the time' to 'all of the time'. These are coded A1 to A5 respectively by Limesurvey.
Exporting the responses often results in strings (with non-numerical characters) where I would want numerical values as a code. So I searched up the encoding command. (the alternative would be to use global find and replace on excel but I want to find a way to do this on Stata, so I can instantly transform any new responses appropriately using a do file).
Problem: Encoding option encodes from A1 to A5 as 1 to 5 but I'd rather it start from 0.
Question: Is there a way to exactly tell Stata how to encode such responses? Or a better way to assign numerical codes to the string answers from the survey rather than encode? I'm aware that maybe my only option is to generate a new variable using if and replace but that seems inelegant and Id have to repeat it many many times for all of the questions.
Any help would be greatly appreciated.
Comment