<?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: Count of number of respondents who answered a question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673735#M202731</link>
    <description>&lt;P&gt;Here's a statement you can use within a DATA step.&amp;nbsp; It creates a variable that is 1 when the respondent has more than 1 pet, and 0 when the respondent has 0 or 1 pet.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;multiple_pets = sum(of q15_1 - q15_16) &amp;gt; 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Presumably you can work with that to get any result that you have asked for.&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jul 2020 14:58:55 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-07-31T14:58:55Z</dc:date>
    <item>
      <title>Count of number of respondents who answered a question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673637#M202699</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of 15k respondents (each has a customer id), who have answered questions about the no. of pets they have (ranges 0 - as many pets they have). I have 6 variables (1 for no. of dogs, 2 for no. of cats, etc.): Q15_1 Q15_2 ... Q15_6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Irrespective of the type of pet and the no. of pets under each category, I need to find the no. of respondents with more than 1 pet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if respondent 23 has answered that he has 2 dogs (Q15_1) and 1 cat (Q15_2), and respondent 42 has answered that he has 2 cats (Q15_2) , they should both be regarded as respondents with more than 1 pet.&lt;/P&gt;&lt;P&gt;How can I do that in SAS? Is Proc Tabulate to be used for this? Any help is appreciated as I have never used it before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is sample data.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MS&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 09:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673637#M202699</guid>
      <dc:creator>mszommer</dc:creator>
      <dc:date>2020-07-31T09:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count of number of respondents who answered a question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673647#M202701</link>
      <description>&lt;P&gt;Can you post some sample data please? Makes it much easier to provide a usable code answer&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 09:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673647#M202701</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-31T09:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count of number of respondents who answered a question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673652#M202702</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;, I just did</description>
      <pubDate>Fri, 31 Jul 2020 09:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673652#M202702</guid>
      <dc:creator>mszommer</dc:creator>
      <dc:date>2020-07-31T09:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count of number of respondents who answered a question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673735#M202731</link>
      <description>&lt;P&gt;Here's a statement you can use within a DATA step.&amp;nbsp; It creates a variable that is 1 when the respondent has more than 1 pet, and 0 when the respondent has 0 or 1 pet.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;multiple_pets = sum(of q15_1 - q15_16) &amp;gt; 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Presumably you can work with that to get any result that you have asked for.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-of-number-of-respondents-who-answered-a-question/m-p/673735#M202731</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-07-31T14:58:55Z</dc:date>
    </item>
  </channel>
</rss>

