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

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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