<?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: recode likert response to binary in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/recode-likert-response-to-binary/m-p/280421#M7964</link>
    <description>&lt;P&gt;While you could use a set of if-then-else statements to accomplish that, here's an alternative to that approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds1;
    length score $20;
    input subjid 1 score $ 4-13;

datalines;
1  Large
2  average
3  small
4  very small
5  Large
6  ittybitty
7  small
8  very small
9  not large
10 average
11 small
12 very small
;
run;

proc format;
    invalue likertf "Large","average"=1
		    "small","very small"=0
		    other=.;
run;

data ds2;
    set ds1;

    likertnum = input(score,likertf.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2016 13:55:38 GMT</pubDate>
    <dc:creator>slacey</dc:creator>
    <dc:date>2016-06-27T13:55:38Z</dc:date>
    <item>
      <title>recode likert response to binary</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/recode-likert-response-to-binary/m-p/279405#M7913</link>
      <description>&lt;P&gt;My original output shows as&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1)Large&lt;/P&gt;&lt;P&gt;(2)average&lt;/P&gt;&lt;P&gt;(3)small&lt;/P&gt;&lt;P&gt;(4)very small&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to recode the "large" and "average" as 1&lt;/P&gt;&lt;P&gt;and "small" and "very small" as 0&lt;/P&gt;&lt;P&gt;all others will be missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I do this in sas? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/recode-likert-response-to-binary/m-p/279405#M7913</guid>
      <dc:creator>wbrown</dc:creator>
      <dc:date>2016-06-22T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: recode likert response to binary</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/recode-likert-response-to-binary/m-p/280421#M7964</link>
      <description>&lt;P&gt;While you could use a set of if-then-else statements to accomplish that, here's an alternative to that approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds1;
    length score $20;
    input subjid 1 score $ 4-13;

datalines;
1  Large
2  average
3  small
4  very small
5  Large
6  ittybitty
7  small
8  very small
9  not large
10 average
11 small
12 very small
;
run;

proc format;
    invalue likertf "Large","average"=1
		    "small","very small"=0
		    other=.;
run;

data ds2;
    set ds1;

    likertnum = input(score,likertf.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 13:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/recode-likert-response-to-binary/m-p/280421#M7964</guid>
      <dc:creator>slacey</dc:creator>
      <dc:date>2016-06-27T13:55:38Z</dc:date>
    </item>
  </channel>
</rss>

