<?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: Averaging duplicate samples in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929844#M365834</link>
    <description>Hi Tom, thanks for your help! I didn’t want the zero averaging with the main sample because most of the time a zero is due to a user error/malfunction (the sampler is clogged, someone forgot to run it, etc). Usually a note is made but sometimes it isn’t, I figure if the duplicate yielded a zero then there was no need to average it with the main sample.</description>
    <pubDate>Mon, 27 May 2024 18:57:42 GMT</pubDate>
    <dc:creator>lu_king</dc:creator>
    <dc:date>2024-05-27T18:57:42Z</dc:date>
    <item>
      <title>Averaging duplicate samples</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929840#M365832</link>
      <description>I have a data set that contains date of sample, site locations, main samples duplicate samples, and PH levels. I am trying to average the non-zero duplicate samples with the main samples, specific to the location (matching SA to SA, and AU to AU). Any advice would be appreciated!&lt;BR /&gt;&lt;BR /&gt;For example,&lt;BR /&gt;Date location sample ph level&lt;BR /&gt;5/6 SA Main 2.5&lt;BR /&gt;5/7 SA Dup 6.467&lt;BR /&gt;5/6 AU Main .04&lt;BR /&gt;5/7 AU Dup 0</description>
      <pubDate>Mon, 27 May 2024 18:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929840#M365832</guid>
      <dc:creator>lu_king</dc:creator>
      <dc:date>2024-05-27T18:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Averaging duplicate samples</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929842#M365833</link>
      <description>&lt;P&gt;Should be simple.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
  by date location;
  var ph_level;
   output out=want mean=mean_ph_level;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't understand this part "&lt;SPAN&gt;the non-zero duplicate samples with the main samples".&amp;nbsp; 0 should be a perfectly valid value of pH.&amp;nbsp; Why would you want to exclude them?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 18:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929842#M365833</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-27T18:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Averaging duplicate samples</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929844#M365834</link>
      <description>Hi Tom, thanks for your help! I didn’t want the zero averaging with the main sample because most of the time a zero is due to a user error/malfunction (the sampler is clogged, someone forgot to run it, etc). Usually a note is made but sometimes it isn’t, I figure if the duplicate yielded a zero then there was no need to average it with the main sample.</description>
      <pubDate>Mon, 27 May 2024 18:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929844#M365834</guid>
      <dc:creator>lu_king</dc:creator>
      <dc:date>2024-05-27T18:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Averaging duplicate samples</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929847#M365836</link>
      <description>&lt;P&gt;Maybe add a WHERE statement to Tom's code, e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
  by date location;
  var ph_level;
  output out=want mean=mean_ph_level;
  where ph_level ne 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
  by date location;
  var ph_level;
  output out=want mean=mean_ph_level;
  where NOT (location='Dup' and ph_level=0) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 May 2024 20:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Averaging-duplicate-samples/m-p/929847#M365836</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-27T20:13:41Z</dc:date>
    </item>
  </channel>
</rss>

