<?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: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701036#M214614</link>
    <description>&lt;P&gt;I don't remember you asking for an "N",rather "th the N being the number of people who responded to that question" where 1 indicated they responded. If that is not what the 1 in your data means, then please describe otherwise. The SUM is the number of people that answered 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did the code I showed as an example do what was intended for the limited example of data you provided? If so, then there is something else going on with your actual data that you need to provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you need to provide some actual example data with the " did not provide an answer at all " and what the expected result would be. It would also help to show the actual code your ran. Best way to do this is to copy from the LOG the code and any notes related to the procedure and then paste that into a code box. That way there is not question as to what was actually executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Proc Tabulate you &lt;STRONG&gt;must&lt;/STRONG&gt; be careful the values of your class variables. If any of the class variables are missing then the record is excluded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 20:28:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-11-23T20:28:08Z</dc:date>
    <item>
      <title>Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698558#M213652</link>
      <description>&lt;P&gt;Hi, I am a SAS beginner. I have some data that I need to tabulate: frequency, N and percent tabulations, by another variable (location). The data is from a multiple-choice survey question - there are 20 different multiple choice options, and respondents can choose up to 3 options. I'd like to be able to tabulate the frequency of each option for Location A, Location B, Location C, etc. and calculate the percentage, with the N being the number of people who responded to that question. So I wouldn't want to tabulate rows where none of the option choices have been selected. --&amp;gt; (Can I accomplish this by creating a new variable that concatenates variables of all 20 variables, and then exclude rows with 20 0s?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Location_1 Popn_1 Popn_2 Popn_3 Popn_4.....&lt;BR /&gt;&lt;BR /&gt;CityA 1 0 0 0&lt;BR /&gt;CityB 0 0 0 0&lt;BR /&gt;CityC 0 0 0 0&lt;BR /&gt;CityB 0 0 0 0&lt;BR /&gt;CityB 0 1 0 0&lt;BR /&gt;CityC 0 0 0 0&lt;BR /&gt;CityD 0 1 0 0&lt;BR /&gt;CityE 0 0 0 0&lt;BR /&gt;CityF 0 0 0 0&lt;BR /&gt;CityE 1 0 0 0&lt;BR /&gt;CityD 1 0 0 0&lt;BR /&gt;CityC 1 0 0 0&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;I was trying to understand this&amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473759.htm," target="_blank" rel="noopener"&gt;https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473759.htm,&lt;/A&gt;&amp;nbsp;and also&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Analyzing-Multiple-Response-Variables/td-p/485261" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Analyzing-Multiple-Response-Variables/td-p/485261&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran into the same problem as above, was trying this test code:&lt;/P&gt;&lt;PRE&gt;proc tabulate data=cath.testdata2;&lt;BR /&gt;	class location_1;&lt;BR /&gt;	var popn_1-popn_3;&lt;BR /&gt;	table popn_1='Everyone'&lt;BR /&gt;	      popn_2='Child'&lt;BR /&gt;	      popn_3='Youth',&lt;BR /&gt;              (n='Count' pctn='Percent');&lt;BR /&gt;		  &lt;BR /&gt;	title 'Frequency and Counts for Population Choices';&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I know that my data has: 141 records where no option is selected; 496 records in total.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output was:&amp;nbsp;&lt;/P&gt;&lt;DIV class="systitleandfootercontainer"&gt;&lt;P&gt;&lt;SPAN class="c systemtitle"&gt;Frequency and Counts for Population Choices&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Count PercentEveryoneChildrenYouth&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;417&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;417&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;417&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally I would also like to tabulate, for each location, frequency by each variable against the other. (so the number who have selected popn_1 AND popn_2, etc.) (but after solving the above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like something that looks like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;TD&gt;Percent&lt;/TD&gt;&lt;TD&gt;N=355&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1: Checked&lt;/TD&gt;&lt;TD&gt;1: Checked&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CityA&lt;/TD&gt;&lt;TD&gt;Everyone&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Children&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Youth&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;City B&lt;/TD&gt;&lt;TD&gt;Everyone&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;4.23%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Children&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Youth&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks any help provided&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 00:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698558#M213652</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-13T00:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698576#M213663</link>
      <description>&lt;P&gt;Please provide a full bur reduced set of test data (like a dozen rows) as a data step, and the expects outputs.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 05:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698576#M213663</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-13T05:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698609#M213672</link>
      <description>&lt;P&gt;If you have 1/0 coded values then using the variable as a VAR type in tabulate then SUM is the number of 1 values and Mean would be the percent.&lt;/P&gt;
&lt;P&gt;So maybe something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=cath.testdata2;
	class location_1;
	var popn_1-popn_3;
	table popn_1='Everyone'
	      popn_2='Child'
	      popn_3='Youth',
              (Sum='Count'*f=best5. mean='Percent'*f=percent8.1);
	table Location_1 * (popn_1='Everyone'
	      popn_2='Child'
	      popn_3='Youth'),
              (Sum='Count'*f=best5. mean='Percent'*f=percent8.1);
		  
	title 'Frequency and Counts for Population Choices';
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 09:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/698609#M213672</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-13T09:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701009#M214606</link>
      <description>&lt;P&gt;Thank you. I do not understand the numbers the output gives me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my code like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; proc tabulate data=cath.binarydata;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class location sectorcollapsed;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var popn1-popn20;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; table (location='Location'),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (popn1-popn20)*(Sum='Count'*f=best5. mean='Percent'*f=percent8.1 N='Total responses&amp;nbsp; &amp;nbsp; &amp;nbsp; received per question')&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; /box="Populations Served by Location";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting confused about what the numbers mean:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When SAS calculates 'mean', what is the N it is calculating this out of? It uses the same N, it seems for each variable (as you can see below).&lt;/STRONG&gt;&amp;nbsp;Where does it get this N value from? I just want to make sure this is correctly giving me the percentage of responses who chose that option out of the total who responded to the question. Is this correct?&lt;/P&gt;&lt;P&gt;Here is a sample of my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;popn1&lt;/TD&gt;&lt;TD&gt;popn2&lt;/TD&gt;&lt;TD&gt;popn3&lt;/TD&gt;&lt;TD&gt;popn4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;And here is a sample of my output:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Populations&lt;BR /&gt;Served by&lt;BR /&gt;Location&lt;/TD&gt;&lt;TD&gt;popn1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;popn2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;TD&gt;Percent&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;N (Total&lt;/P&gt;&lt;P&gt;responses per&amp;nbsp;&lt;/P&gt;&lt;P&gt;question)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;TD&gt;Percent&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;N(Total responses received per question)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;84.6%&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;15.4%&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Location1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Location2&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;42.3%&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;30.8%&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Location3&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;TD&gt;65.1%&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;20.9%&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 19:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701009#M214606</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-23T19:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701031#M214611</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;, I had a subsequent question - I tried the code you had provided me, but I'm not understanding where the N for the mean comes from. Does it divide by the total number of responses received? I thought the N would be all of the people who answered the question, but it doesn't quite add up like this. As an example, in one of the locations, there were 149 total people in that location, and 19 did not provide an answer at all - so the N here should be 130, but it is giving me a value of 134 in the output. The mean is calculated out of 134. I tried to provide a reply here but I think I did something incorrect, and the posts were deleted.</description>
      <pubDate>Mon, 23 Nov 2020 20:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701031#M214611</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-23T20:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701036#M214614</link>
      <description>&lt;P&gt;I don't remember you asking for an "N",rather "th the N being the number of people who responded to that question" where 1 indicated they responded. If that is not what the 1 in your data means, then please describe otherwise. The SUM is the number of people that answered 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did the code I showed as an example do what was intended for the limited example of data you provided? If so, then there is something else going on with your actual data that you need to provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you need to provide some actual example data with the " did not provide an answer at all " and what the expected result would be. It would also help to show the actual code your ran. Best way to do this is to copy from the LOG the code and any notes related to the procedure and then paste that into a code box. That way there is not question as to what was actually executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Proc Tabulate you &lt;STRONG&gt;must&lt;/STRONG&gt; be careful the values of your class variables. If any of the class variables are missing then the record is excluded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 20:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701036#M214614</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-23T20:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701045#M214618</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Ballard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc tabulate data=cath.binarydata;
	where location in ("location1", "location2", "location3", "location4", "location5", "location6");
	class location sectorcollapsed;
	var popn1-popn20;
	table (location='Location'), 
				(popn1-popn20)*(Sum='Count'*f=best5. mean='Percent'*f=percent8.1 N='Total responses received per question')
				/box="Populations Served by Location";&lt;/PRE&gt;&lt;P&gt;Here is a sample of my data: attached in data.xlsx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is a sample output: sampleoutput.xlsx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to determine how many people didn't answer the question, I filtered for only the blanks on each option for each location in Excel. They didn't add up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't quite understand what value it provides when I use the N statement in the code. That number (as you can see in the sample output) remains the same for each location across the board, and is the number by which the sum is divided in order to get the mean.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sums work perfectly, but I don't understand what the mean is out of for each class value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 20:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701045#M214618</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-23T20:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701056#M214623</link>
      <description>&lt;P&gt;I don't open XLSX files from unknown sources.&lt;/P&gt;
&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you include Sectorcollapsed as a class variable when it is not used?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The mean of a 0/1 coded value is the percentage of 1's provided.&lt;/P&gt;
&lt;P&gt;Consider&lt;/P&gt;
&lt;P&gt;0 0 0 1 1 0 0 0 0 0. That is 2 / 10 or 20%, which is the (SUM of 1s)/(number of values) or a mean. The mean would have a numeric value of 0.2 so we use a Percent format to get "nice" looking values such as 20%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Didn't answer the question" might be the NMISS statistic if that means there is no value at all, i.e. missing. That would indicate the number of missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course when you "filter in Excel" the results don't match. You do not show any corresponding "filter" in the SAS code. You don't even clearly describe how you "filtered" in Excel. So I can't make a suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 20:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701056#M214623</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-23T20:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701073#M214635</link>
      <description>&lt;P&gt;I use the class sectorcollapsed in another table (I only included the code to create the population table in the question). The code for that one is similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've included the data and the output as an image. I only included the first 3 population variables here. As you can see, the N stays consistent across for each location. For location 6, 13 people responded to the question. For Location 5, 26 people responded to the question. (I checked this on Excel by taking the total from each location and filtering out the rows where the sum across the 20 variables was 0 (ie no selection of an option had been made).&amp;nbsp; &amp;nbsp;However, for Location 1 and 2 at the bottom: the values were off (ie the N using the filtering method on Excel for location 1 was 130 responses in total, not including those rows where the sum across 20 rows was 0; and for location 2, it was 39 - but the Ns for the SAS outputs are 134 and 44 respectively.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pre1_1-1606165700799.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51939i83945BBE1EEAE284/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pre1_1-1606165700799.png" alt="Pre1_1-1606165700799.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pre1_0-1606165644859.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51938i9AC6113BDB5A1670/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pre1_0-1606165644859.png" alt="Pre1_0-1606165644859.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 21:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701073#M214635</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-23T21:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Frequency tabulations for multiple-choice variables (20 possible options, 3-5 max)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701092#M214650</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I think it will work the way I expect it to if I delete the 0s in all cells for all the rows that sum up to 0 (ie nothing was selected for that question). *Edit - it worked when I did this&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 22:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Frequency-tabulations-for-multiple-choice-variables-20-possible/m-p/701092#M214650</guid>
      <dc:creator>Pre1</dc:creator>
      <dc:date>2020-11-23T22:28:07Z</dc:date>
    </item>
  </channel>
</rss>

