<?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: How to recode Likert Scale data when importing from SPSS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323435#M271191</link>
    <description>&lt;P&gt;Please post your code as TEXT not as an image, otherwise we need to type out your code to make suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Text needs to be quoted when used in comparisons, otherwise it's looking for a variable. Quote the characters in your recode statement.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2017 18:45:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-01-09T18:45:47Z</dc:date>
    <item>
      <title>How to recode Likert Scale data when importing from SPSS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323427#M271190</link>
      <description>&lt;P&gt;I import a data set from SPSS but the responses are displayed as texts. I want them to be recoded into values that correspond to&amp;nbsp;Strongly Agree = 7, Agree = 6.................. and Strongly Disagree = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13310i50AC221DA4CBB179/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Untitled.png" title="Untitled.png" /&gt;</description>
      <pubDate>Mon, 09 Jan 2017 18:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323427#M271190</guid>
      <dc:creator>ssatyal</dc:creator>
      <dc:date>2017-01-09T18:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode Likert Scale data when importing from SPSS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323435#M271191</link>
      <description>&lt;P&gt;Please post your code as TEXT not as an image, otherwise we need to type out your code to make suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Text needs to be quoted when used in comparisons, otherwise it's looking for a variable. Quote the characters in your recode statement.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 18:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323435#M271191</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-09T18:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode Likert Scale data when importing from SPSS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323440#M271192</link>
      <description>&lt;P&gt;You cannot change the variable type from character to numeric for an existing SAS variable. Best, for&amp;nbsp; a number of reasons would be recode into a new varaible that would be numeric. I prefer to recode using a custom informat for things like this, especially when there are many variables. Here is a brief example creating an informat and manipulating some dummy data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
invalue Likert (upcase)
"AGREE"=6
"AGREE SOMEWHAT"=5
"NEUTRAL" = 4
"DISAGREE SOMEWHAT"=3
"DISAGREE" = 2
;
RUN;

/* creating some example data*/
Data have;
   infile datalines dlm=',';
   informat Q10_1 Q10_2 $20.;
   input Q10_1 Q10_2;
datalines;
AGREE,   NEUTRAL
DISAGREE SOMEWHAT,  DISAGREE
AGREE SOMEWHAT,   AGREE
;
run;

data want;
   set have;
   array q   q10_1 -  q10_2 ;
   array rq rq10_1 - rq10_2 ;
   do i = 1 to dim(q);
      rq[i] = input(q[i],likert.);
   end;
   drop i;
run;&lt;/PRE&gt;
&lt;P&gt;You could put as many variables on the Q array as there are coded alike just make sure there is a corresponding value in the R array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lining things up as I did in&amp;nbsp; the editor may help with that though I would would start with copy the like with the array q and then use the editor search and replace to find q and replace with rq.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 19:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-Likert-Scale-data-when-importing-from-SPSS/m-p/323440#M271192</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-09T19:03:46Z</dc:date>
    </item>
  </channel>
</rss>

