Hi....I have survey data that consist of two columns (Question, Response) that has been converted to numeric. I would like to convert the data to its original responses. Is there a way to specify which questions (they are number by Q1, Q2,....) to apply each formatting as not all questions have the same ranges. Thanks.
proc format;
value resp
1='Disagree'
2='Neutral'
3='Agree'
;
proc format;
value Gender
1='Male'
2='Female'
;
Please provide something that looks like your data.
If you actually only have two variables in the data then to do what you want you likely need to transpose the data so that you have one observation per data respondent. How to do that depends on the actual data that you have.
Something like:
ID Var1 Var2
where Var1 has the numeric value for the first question response and Var2 has the numeric value of the second question.
Then you would assign the formats with something like:
format var1 resp. var2 gender. ;
Please provide something that looks like your data.
If you actually only have two variables in the data then to do what you want you likely need to transpose the data so that you have one observation per data respondent. How to do that depends on the actual data that you have.
Something like:
ID Var1 Var2
where Var1 has the numeric value for the first question response and Var2 has the numeric value of the second question.
Then you would assign the formats with something like:
format var1 resp. var2 gender. ;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.