<?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: What would be the best sas procedure for this dataset? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450222#M69696</link>
    <description>&lt;P&gt;Sounds like your top table could be compiled with something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table polCounts as
select
    County,
    Site,
    Pollutant,
    sum(matrix="Soil") as nbSoil,
    sum(matrix="Groundwater") as nbWater
from myData
group by County, Site, Pollutant;
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where &lt;EM&gt;myTable&lt;/EM&gt; would be your input data table with columns County, Site, Pollutant, and Matrix ("Soil" or "Groundwater")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;replace &lt;STRONG&gt;sum(matrix="Soil") as nbSoil&lt;/STRONG&gt; with &lt;STRONG&gt;sum(matrix="Soil") &amp;gt; 0&amp;nbsp;as nbSoil&lt;/STRONG&gt; if you only want zeros and ones.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Apr 2018 04:15:20 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-04-01T04:15:20Z</dc:date>
    <item>
      <title>What would be the best sas procedure for this dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450203#M69693</link>
      <description>&lt;P&gt;Hey guys. New here and I have no clue if I'm asking this in the right place but I need help. Bear with me as I try to explain this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm working on a research project to analyze and rank the most contaminated areas in the state of Georgia. I managed to make a list of all the counties&amp;nbsp;in Georgia that contain 1 or more toxic sites by compiling the data found in Georgia's EPA Hazardous Site Inventory. From this, I made a Top 5 list with which I will need help. So my goal is to analyze and rank which pollutants are most commonly found in the Top 5 county list. I would like to make a Top 10 list of pollutants from this analysis. So to do that, I would have to go through each individual site for all 5 counties and make a list of pollutants. For example, Site A for Cobb County might have 12 pollutants, while Site B has only 5. So Cobb will have 17 total and then I'd move on to the next county. However each pollutant in each site is further categorized by soil or groundwater. So it can be found in soil, groundwater, or both.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to Hazardous Site Inventory:&amp;nbsp;&lt;A href="http://epd.georgia.gov/sites/epd.georgia.gov/files/2017HSI/10145.pdf&amp;nbsp;" target="_blank"&gt;http://epd.georgia.gov/sites/epd.georgia.gov/files/2017HSI/10145.pdf&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My professor introduced me to someone in the Stats Department who was more knowledgeable in SAS. He was able to draw&amp;nbsp;out a quick sketch of what the table should probably look like. Then he further went on to say that SAS would be the perfect program to crank out this kind of table and using proc freq is the way to go. He said that SAS has the ability to create both of these tables in the sketch. I'm just confused on what the code should be for both of them. I know proc.freq is used for the second one but I think it would need some tweaking that I'm not familiar with. For the code to make the first table to include all the variables, I have no clue on what the code would be.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20180331_171658.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19558i43B1BBB208AD4975/image-size/large?v=v2&amp;amp;px=999" role="button" title="20180331_171658.jpg" alt="20180331_171658.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: Thought it would be more clear to see, but Pol = Pollutant. S and W means Soil and Water (Groundwater), respectively. For S and W, he used 0 and 1 to indicate whether the pollutant was found in soil or groundwater, just to be clear. Kinda like how 0 and 1 is used to indicate Gender.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm assuming I'll have to make an excel spreadsheet containing the sites, counties, pollutants, and then upload this into the SAS library to create the tables, correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this sounds all over the place. I'm just really confused on how to get started on this. Any help would be REALLY appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 22:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450203#M69693</guid>
      <dc:creator>sfletc15</dc:creator>
      <dc:date>2018-03-31T22:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the best sas procedure for this dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450211#M69694</link>
      <description>&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;Hi there.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;Seems like you have been advised to do a 4-way table with Proc freq.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;This&amp;nbsp;&lt;A title="The FREQ Procedure" href="http://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/viewer.htm#procstat_freq_overview.htm" target="_self"&gt;The FREQ Procedure&lt;/A&gt;&amp;nbsp;will be useful to you.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT face="georgia,palatino"&gt;You can use import wizards from the File menu&amp;nbsp;in SAS&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="georgia,palatino"&gt;if you are not confident to write code depending on how your input data file is like&amp;nbsp; (.xls&amp;nbsp; or .csv or .txt or stata or spss or other formats)&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="georgia,palatino"&gt;to read your data into SAS. However, csv&amp;nbsp; is preferred&amp;nbsp;because it will generate the code for you which you can reuse after loading the data into SAS.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;Good luck.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 02:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450211#M69694</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2018-04-01T02:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the best sas procedure for this dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450222#M69696</link>
      <description>&lt;P&gt;Sounds like your top table could be compiled with something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table polCounts as
select
    County,
    Site,
    Pollutant,
    sum(matrix="Soil") as nbSoil,
    sum(matrix="Groundwater") as nbWater
from myData
group by County, Site, Pollutant;
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where &lt;EM&gt;myTable&lt;/EM&gt; would be your input data table with columns County, Site, Pollutant, and Matrix ("Soil" or "Groundwater")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;replace &lt;STRONG&gt;sum(matrix="Soil") as nbSoil&lt;/STRONG&gt; with &lt;STRONG&gt;sum(matrix="Soil") &amp;gt; 0&amp;nbsp;as nbSoil&lt;/STRONG&gt; if you only want zeros and ones.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 04:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-best-sas-procedure-for-this-dataset/m-p/450222#M69696</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-04-01T04:15:20Z</dc:date>
    </item>
  </channel>
</rss>

