<?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 create a scale of number of responses to a group of variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231657#M54592</link>
    <description>&lt;P&gt;If your binary variables named x1 through x5 are numeric and coded as 0 or 1, this is pretty easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvariable=sum(of x1-x5);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Oct 2015 16:02:30 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-10-26T16:02:30Z</dc:date>
    <item>
      <title>How to create a scale of number of responses to a group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231654#M54591</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create a new variable in a data set which would act&amp;nbsp;as a scale reflecting the number of positive responses among a group of other variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, there are 5 variables with categorical, binary responses (yes/no), and I want to make a new variable which would have 6&amp;nbsp;categorical responses which might be&amp;nbsp;All Five, Four, Three, Two, One and None. For example, an observation with a 'Yes'&amp;nbsp;response to 2 of the 5 variables would warrant a "Two" in my new variable. Three 'Yes's' would be a Three, and so on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Making the 'All 5' and 'None' is easy, and I know I could sort of use brute force and set up if-then statements for all the possible combinations for 2, 3, and 4, but I feel there may be a simpler and less error-prone way to go about this in a data statement. Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 15:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231654#M54591</guid>
      <dc:creator>jloft12</dc:creator>
      <dc:date>2015-10-26T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scale of number of responses to a group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231657#M54592</link>
      <description>&lt;P&gt;If your binary variables named x1 through x5 are numeric and coded as 0 or 1, this is pretty easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvariable=sum(of x1-x5);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2015 16:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231657#M54592</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-26T16:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scale of number of responses to a group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231660#M54593</link>
      <description>&lt;P&gt;Hi mate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you only need to make this new variable&amp;nbsp;about the YES ?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 16:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231660#M54593</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-10-26T16:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a scale of number of responses to a group of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231874#M54619</link>
      <description>&lt;P&gt;Hi, if you really want words ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input x1-x5;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;. . . . .&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;0 0 0 0 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 0 0 0 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 1 0 0 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 1 1 0 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 1 1 1 0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 1 1 1 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;score = upcase(put(sum(of x: ),words.));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x1 x2 x3 x4 x5 score&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;. &amp;nbsp;. &amp;nbsp;. &amp;nbsp;. &amp;nbsp;. MISSING&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 ZERO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1 &amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 ONE&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;0 &amp;nbsp;0 &amp;nbsp;0 TWO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;0 &amp;nbsp;0 THREE&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;0 FOUR&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 &amp;nbsp;1 FIVE&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-scale-of-number-of-responses-to-a-group-of/m-p/231874#M54619</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-27T17:13:51Z</dc:date>
    </item>
  </channel>
</rss>

