Please, anyone, tell me how to use the reverse function or if there is an alternative way to reverse the Value in a numeric Variable.
The survey questions were measured on a scale of 0 (least) to 3 (most).
However, the data were recorded inconsistently by data entry clerks; and questions 2, 3, and 5 (for every visit) were accidentally recorded in the reverse order (0=most and 3=least). Convert questions 2, 3, and 5 for every visit so that they are measured in the same direction as the other questions.
What I did is using
data surveyB;
set survey_1;
backward=reverse('Q3');
put backward=;
run;
proc print data = surveyB; run;
Simple math will do this. Let's see, you want them to be 0 (least) and 3 (most), but some questions have 3 (least) and 0 (most), then for those questions something like this:
correct_score = -score + 3;
Simple math will do this. Let's see, you want them to be 0 (least) and 3 (most), but some questions have 3 (least) and 0 (most), then for those questions something like this:
correct_score = -score + 3;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: