<?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: Total Score without counting rows with missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906271#M357856</link>
    <description>&lt;P&gt;YES! Thank you so much!!!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2023 16:45:55 GMT</pubDate>
    <dc:creator>RNscientist</dc:creator>
    <dc:date>2023-12-05T16:45:55Z</dc:date>
    <item>
      <title>Total Score without counting rows with missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906264#M357853</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to sum 5 columns to get a total score for each participant (row); however, I don't want SAS to sum rows with missing data, but I also don't want to delete those participants as I have data for them on a different variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;sum_W1= sum(var1, var2, var3, var4, var5);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however this sums across the row even if I'm missing data in 4 out of the 5 columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var 1&amp;nbsp; var 2 var 3&amp;nbsp; var 4&amp;nbsp; &amp;nbsp;var 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is giving me a total score of 3 but I want it to read .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 16:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906264#M357853</guid>
      <dc:creator>RNscientist</dc:creator>
      <dc:date>2023-12-05T16:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Total Score without counting rows with missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906269#M357855</link>
      <description>&lt;P&gt;This might suit what you are asking for:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if n(of var1-var5) = 5 then sum_W1=sum(of var1-var5);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure you include that key word "of".&amp;nbsp; Without it, SAS will compute var1 minus var5.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 16:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906269#M357855</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-12-05T16:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Total Score without counting rows with missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906271#M357856</link>
      <description>&lt;P&gt;YES! Thank you so much!!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 16:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906271#M357856</guid>
      <dc:creator>RNscientist</dc:creator>
      <dc:date>2023-12-05T16:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Total Score without counting rows with missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906295#M357857</link>
      <description>&lt;P&gt;Admittedly long to type for many variables but the + operator will return missing if any of the variables are missing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;sum_W1= var1+ var2+ var3+ var4+ var5;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2023 17:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Total-Score-without-counting-rows-with-missing-data/m-p/906295#M357857</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-12-05T17:25:09Z</dc:date>
    </item>
  </channel>
</rss>

