<?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: How to average duplicate target samples? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929862#M365844</link>
    <description>&lt;P&gt;Why attach a file to share a hand full of values?&lt;/P&gt;
&lt;PRE&gt;date sample tylocation target levels
6-May main EU N.GIII 32
6-May dupe EU N.GIII 456
7-May main PR CII 645465
7-May dupe PR CII 0
20-May main HU AGI 0
20-May dupe HU AGI 64875833&lt;/PRE&gt;
&lt;P&gt;Can you code the rules that explain which values you want to ignore?&amp;nbsp; Use them to make a NEW variable (so your original data is not lost) which has MISSING values where you don't want to use the original value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data for_analysis;
  set have;
  new_var = levels;
&amp;nbsp;&amp;nbsp;if&amp;nbsp;levels=0&amp;nbsp;then&amp;nbsp;new_var=.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can take the MEAN() of your new variable.&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 22:48:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-05-27T22:48:44Z</dc:date>
    <item>
      <title>How to average duplicate target samples?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929846#M365835</link>
      <description>Hi everybody! I would like to create an additional variable that is the average of my duplicate target levels with my main target levels. I don’t want the 0’s to average with another sample though. For example on May 6, located at EU, there are two levels for the N.GIII target…I’d like to average those together, but on May 20, located at HU, the duplicate sample is a non-zero, I don’t want to average that value, with the zero in the main sample. Any guidance would be appreciated!</description>
      <pubDate>Mon, 27 May 2024 19:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929846#M365835</guid>
      <dc:creator>lu_king</dc:creator>
      <dc:date>2024-05-27T19:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to average duplicate target samples?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929856#M365839</link>
      <description>&lt;P&gt;Turn the zeros into missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, most of us refuse to download Excel (or Microsoft Office) files as they can be a security threat. The proper way to include data is as text in working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 21:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929856#M365839</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-27T21:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to average duplicate target samples?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929862#M365844</link>
      <description>&lt;P&gt;Why attach a file to share a hand full of values?&lt;/P&gt;
&lt;PRE&gt;date sample tylocation target levels
6-May main EU N.GIII 32
6-May dupe EU N.GIII 456
7-May main PR CII 645465
7-May dupe PR CII 0
20-May main HU AGI 0
20-May dupe HU AGI 64875833&lt;/PRE&gt;
&lt;P&gt;Can you code the rules that explain which values you want to ignore?&amp;nbsp; Use them to make a NEW variable (so your original data is not lost) which has MISSING values where you don't want to use the original value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data for_analysis;
  set have;
  new_var = levels;
&amp;nbsp;&amp;nbsp;if&amp;nbsp;levels=0&amp;nbsp;then&amp;nbsp;new_var=.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can take the MEAN() of your new variable.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 22:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-average-duplicate-target-samples/m-p/929862#M365844</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-27T22:48:44Z</dc:date>
    </item>
  </channel>
</rss>

