BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
twildone
Pyrite | Level 9

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'
;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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. ;

 

View solution in original post

1 REPLY 1
ballardw
Super User

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. ;

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 500 views
  • 0 likes
  • 2 in conversation