<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reverse the Value in a numeric Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817600#M322722</link>
    <description>Thank you so much.</description>
    <pubDate>Sat, 11 Jun 2022 14:16:08 GMT</pubDate>
    <dc:creator>Malk020</dc:creator>
    <dc:date>2022-06-11T14:16:08Z</dc:date>
    <item>
      <title>Reverse the Value in a numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817596#M322718</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN&gt;The survey questions were measured on a scale of 0 (least) to 3 (most). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I did is using&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data surveyB;&lt;BR /&gt;set survey_1;&lt;BR /&gt;backward=reverse('Q3');&lt;BR /&gt;put backward=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = surveyB; run;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 11 Jun 2022 13:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817596#M322718</guid>
      <dc:creator>Malk020</dc:creator>
      <dc:date>2022-06-11T13:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse the Value in a numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817597#M322719</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;correct_score = -score + 3;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 13:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817597#M322719</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-11T13:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse the Value in a numeric Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817600#M322722</link>
      <description>Thank you so much.</description>
      <pubDate>Sat, 11 Jun 2022 14:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-the-Value-in-a-numeric-Variable/m-p/817600#M322722</guid>
      <dc:creator>Malk020</dc:creator>
      <dc:date>2022-06-11T14:16:08Z</dc:date>
    </item>
  </channel>
</rss>

