<?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: Summarizing and Manipulating Data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213568#M11534</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Mark! Your code gave me exactly what I wanted! Perfect!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jul 2015 21:00:35 GMT</pubDate>
    <dc:creator>acros</dc:creator>
    <dc:date>2015-07-29T21:00:35Z</dc:date>
    <item>
      <title>Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213563#M11529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to take data that's in this form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="249" style="border: 1px solid #000000; width: 120px; height: 218px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;County FIPS&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Survey Question&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22001&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1 (yes)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22001&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1 (yes)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22001&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2 (no)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22001&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1 (yes)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22003&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;9 (refused)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22003&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1 (yes)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22003&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1 (yes)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22005&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1 (yes)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22005&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;2 (no)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And get summary statistics (percent that said no for each county) in this form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 162px; height: 94px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;County FIPS&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Percent No&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22001&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;25%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22003&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;22005&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;50%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using PROC FREQ in various ways to create different outputs, but I'm not getting this simple and straightforward output - County and % No.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would greatly appreciate any guidance or suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, error in original second table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 19:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213563#M11529</guid>
      <dc:creator>acros</dc:creator>
      <dc:date>2015-07-29T19:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213564#M11530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't come up with the same numbers that you do but here is a solution, there's probably a neater way to do this with proc summary but I'm not too experienced with it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;length County_FIPS $5. Survey_Question $11.;&lt;/P&gt;&lt;P&gt;input County_FIPS$ Survey_Question$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22001,2 (no)&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22003,9 (refused)&lt;/P&gt;&lt;P&gt;22003,1 (yes)&lt;/P&gt;&lt;P&gt;22003,1 (yes)&lt;/P&gt;&lt;P&gt;22005,1 (yes)&lt;/P&gt;&lt;P&gt;22005,2 (no)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select county_fips,count(survey_question)/counts as percent_no&lt;/P&gt;&lt;P&gt;from (select county_fips,survey_question,count(survey_question) as counts&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;group by county_fips)&lt;/P&gt;&lt;P&gt;where survey_question contains 'no'&lt;/P&gt;&lt;P&gt;group by county_fips;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to count refused you can change 'contains 'no'' to 'not contains 'yes'' but it's 33%, not 67%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select county_fips,count(survey_question)/counts as Percent_No format = percent.&lt;/P&gt;&lt;P&gt;from (select county_fips,survey_question,count(survey_question) as counts&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;group by county_fips)&lt;/P&gt;&lt;P&gt;where survey_question not contains 'yes'&lt;/P&gt;&lt;P&gt;group by county_fips;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Mark Johnson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 19:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213564#M11530</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-29T19:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213565#M11531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand your results for FIPS=22003. Shouldn't it be 0%? Or do you want to count 9=refuced as a "no"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway:&lt;/P&gt;&lt;P&gt;1) sort the data by FIPS&lt;/P&gt;&lt;P&gt;2) Create a format which has the value "No" for the answers that you consider to be negative.&lt;/P&gt;&lt;P&gt;3) Use PROC FREQ to tabulate the binary formatted variable BY FIPS&lt;/P&gt;&lt;P&gt;4) Keep only the observations that have the formatted value "No"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example where I take the sashelp.cars data and make "No" mean that the cars do not have 6 cylinders:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=sashelp.cars out=cars;&lt;BR /&gt;by origin;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value YESNO 6="Yes"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; other="No ";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=cars noprint;&lt;BR /&gt;format Cylinders YESNO.;&lt;BR /&gt;by origin;&lt;BR /&gt;tables Cylinders / missing out=FreqOut;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=FreqOut;&lt;BR /&gt;where put(cylinders,YESNO.)="No";&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 19:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213565#M11531</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-07-29T19:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213566#M11532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This does raw count percentages:&lt;/P&gt;&lt;P&gt;proc freq data=have noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables fips*survey_question/ list out=want(where=(survey_question= "&lt;SPAN style="font-size: 13.33px;"&gt;2 (no)&lt;/SPAN&gt;"));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=want noobs;&lt;/P&gt;&lt;P&gt;var&amp;nbsp; fips percent;&lt;/P&gt;&lt;P&gt;label fips='County FIPS'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent = "Percent No"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or another way: When interested in a specific level of a variable you can create a dichotomous 1/0 for yes/no values and summarize that.&lt;/P&gt;&lt;P&gt;One question: are refused to be considered in denominator or not?&lt;/P&gt;&lt;P&gt;If you want refused (or don't know or other possible not applicable responses) in denominator:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not missing(survey_question) then SQ_d = (survey_question = "&lt;SPAN style="font-size: 13.33px;"&gt;2 (no)&lt;/SPAN&gt;");&lt;/P&gt;&lt;P&gt;The not missing is to avoid creating a record with a code when the question has no response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To exclude the refused or others, something like:&lt;/P&gt;&lt;P&gt;If not missing(survey_question) and survey_question ne "9 (refused)"&amp;nbsp; then SQ_d = (survey_question = "&lt;SPAN style="font-size: 13.33px;"&gt;2 (no)&lt;/SPAN&gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mean of the SQ_D variable would be a percent No for those answered in decimal.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are questions then:&lt;/P&gt;&lt;P&gt;Are there weights to be applied? Then you need to apply the weights using an appropriate procedure with a weight statement. Proc means or summary would work with Fips as a class variable.&lt;/P&gt;&lt;P&gt;And if so are they complex? Now you need to move to Proc SurveyFreq or Surveymeans.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I say that whoever is providing data as 1 (yes) isn't doing any favors? A value of 1,2,9 and knowledge of the coding works well. Values of "yes", "no", "refused" works well. Both adds way to much text and likelihood of coding issues with extra () and getting quotes in the right spots.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 19:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213566#M11532</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-29T19:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213567#M11533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems like a straight proc freq unless I'm missing something:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;length County_FIPS $5. Survey_Question $11.;&lt;/P&gt;&lt;P&gt;input County_FIPS$ Survey_Question$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22001,2 (no)&lt;/P&gt;&lt;P&gt;22001,1 (yes)&lt;/P&gt;&lt;P&gt;22003,9 (refused)&lt;/P&gt;&lt;P&gt;22003,1 (yes)&lt;/P&gt;&lt;P&gt;22003,1 (yes)&lt;/P&gt;&lt;P&gt;22005,1 (yes)&lt;/P&gt;&lt;P&gt;22005,2 (no)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;where Survey_Question ne '9 (refused)';&lt;/P&gt;&lt;P&gt;table county_fips*survey_question/list outpct out=want(where=(survey_question='2 (no)')) sparse;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data= want;&lt;/P&gt;&lt;P&gt;var county_fips pct_row;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 19:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213567#M11533</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-29T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213568#M11534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Mark! Your code gave me exactly what I wanted! Perfect!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 21:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213568#M11534</guid>
      <dc:creator>acros</dc:creator>
      <dc:date>2015-07-29T21:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213569#M11535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I corrected my table. Would this give me percentages, not just counts? Mark's solution worked perfectly so I can use that. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 21:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213569#M11535</guid>
      <dc:creator>acros</dc:creator>
      <dc:date>2015-07-29T21:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing and Manipulating Data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213570#M11536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H3&gt;Code: Program&lt;/H3&gt;&lt;PRE class="sce-render" style="font-family: 'Courier New', Menlo, 'Lucida Console'; font-size: 16px;"&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;infile&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;dsd&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;length&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;County_FIPS&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;$5.&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;Survey_Question&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;$11.&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;input&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;County_FIPS&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;Survey_Question&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22001,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22001,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22001,2 (no)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22001,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22003,9 (refused)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22003,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22003,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22005,1 (yes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;22005,2 (no)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;proc&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;select&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;County_FIPS&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;Survey_Question&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;contains&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'no'&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;/&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;count&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;*&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;per&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;format&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;percent8.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;from&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;group&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;by&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;County_FIPS&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #353535; font-family: Lato, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;HR /&gt;&lt;H3&gt;Log: Program&lt;/H3&gt;&lt;P&gt;Notes (3)&lt;/P&gt;&lt;DIV class="sasSource" style="color: #000000;"&gt; 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;P&gt;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 53&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 54 Data have;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 55 infile cards dsd;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 56 length County_FIPS $5. Survey_Question $11.;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 57 input County_FIPS$ Survey_Question$;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 58 cards;&lt;/P&gt;&lt;P class="sasNote" id="sasLogNote1_1438258603077" style="color: #0000ff;"&gt; NOTE: The data set WORK.HAVE has 9 observations and 2 variables.&lt;/P&gt;&lt;P class="sasNote" id="sasLogNote2_1438258603077" style="color: #0000ff;"&gt; NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; real time 0.00 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; cpu time 0.00 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 68 ;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 69 proc sql;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 70 select County_FIPS,sum(Survey_Question contains 'no')/count(*) as per format=percent8.2&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 71 from have&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 72 group by County_FIPS;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 73 quit;&lt;/P&gt;&lt;P class="sasNote" id="sasLogNote3_1438258603077" style="color: #0000ff;"&gt; NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; real time 0.02 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; cpu time 0.03 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 74&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 85&amp;nbsp; &lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #353535; font-family: Lato, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="color: #353535; font-family: Lato, sans-serif; font-size: 14px;"&gt;&lt;/P&gt;&lt;HR /&gt;&lt;H3&gt;Results: Program&lt;/H3&gt;&lt;DIV class="ods_eea61a39-14a6-4bb7-be71-9f0871470929" id="div_eea61a39-14a6-4bb7-be71-9f0871470929"&gt;&lt;DIV class="c body" id="div_eea61a39-14a6-4bb7-be71-9f0871470929" style="margin: 1em 8px; font-size: x-small; text-align: center; color: #000000; font-family: Arial, 'Albany AMT', Helvetica, Helv; background-color: #fafbfe;"&gt;&lt;TABLE class="table" style="margin-bottom: 1em; border-style: solid; border-width: 1px 0px 0px 1px; border-color: #c1c1c1; margin-left: auto; margin-right: auto;"&gt;&lt;TBODY&gt;&lt;TR style="border-top-width: 1px; border-top-color: #c1c1c1; border-bottom-color: #c1c1c1;"&gt;&lt;TD class="data" style="text-align: left; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;22001&lt;/TD&gt;&lt;TD class="r data" style="text-align: right; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;25.00%&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border-top-width: 1px; border-top-color: #c1c1c1; border-bottom-color: #c1c1c1;"&gt;&lt;TD class="data" style="text-align: left; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;22003&lt;/TD&gt;&lt;TD class="r data" style="text-align: right; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;0.00%&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border-top-width: 1px; border-top-color: #c1c1c1; border-bottom-color: #c1c1c1;"&gt;&lt;TD class="data" style="text-align: left; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;22005&lt;/TD&gt;&lt;TD class="r data" style="text-align: right; padding: 3px 6px; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; background-color: #ffffff;"&gt;50.00%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Summarizing-and-Manipulating-Data/m-p/213570#M11536</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-07-30T12:20:52Z</dc:date>
    </item>
  </channel>
</rss>

