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