<?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 drop the number of missing values in the Mean function? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944414#M47166</link>
    <description>sorry, my question wasn't clear</description>
    <pubDate>Wed, 18 Sep 2024 13:46:15 GMT</pubDate>
    <dc:creator>bhr-q</dc:creator>
    <dc:date>2024-09-18T13:46:15Z</dc:date>
    <item>
      <title>how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944270#M47156</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;The mean function should consider the number of non-missing values to calculate the mean, but in my case, it considers the number of missing values as well; how can I fix this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean(of var1 var2 ……)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944270#M47156</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-09-17T14:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944275#M47157</link>
      <description>&lt;P&gt;Can you show an example that illustrates the problem?&amp;nbsp; As you say, the mean function is smart enough to ignore missing values. So perhaps you don't have missing values, or there is a mistake in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input x y z ;
  cards ;
1 2 .
;
data want ;
  set have ;
  mymean=mean(x,y,z) ;
  put mymean= ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Returns&lt;/P&gt;
&lt;PRE&gt;375  data want ;
376    set have ;
377    mymean=mean(x,y,z) ;
378    put mymean= ;
379  run ;

mymean=1.5
&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944275#M47157</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-09-17T14:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944279#M47158</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;The mean function should consider the number of non-missing values to calculate the mean, but in my case, it considers the number of missing values as well; how can I fix this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean(of var1 var2 ……)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Example values and code or it didn't happen...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've only been using SAS since 1987 off-an-on and you have to work to force SAS to consider "missing" values in Mean calculations. Perhaps you have some odd convention like -99 or 0 that you think is missing. SAS won't. It has a missing (actually 28 missing values) that would not be included and is typically displayed as "." by default. If&amp;nbsp; your values are anything else they aren't missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;For anyone reading this in future please note the question included in the original post, as seen in the quoted area above, is nothing like what the response marked as "correct" addresses.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 17:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944279#M47158</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-18T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944280#M47159</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;The mean function should consider the number of non-missing values to calculate the mean, but in my case, it considers the number of missing values as well; how can I fix this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean(of var1 var2 ……)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;, no one knows your data and no one knows the code you are using. As a general rule, provide example data and the code with the problem &lt;EM&gt;in your very first post&lt;/EM&gt; from now on. You will get faster answers and better help if you provide example data and your code in the first message of the thread.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 17:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944280#M47159</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-17T17:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944314#M47160</link>
      <description>&lt;P&gt;The &lt;CODE&gt;mean()&lt;/CODE&gt; function in SAS &lt;STRONG&gt;already ignores missing values&lt;/STRONG&gt; by default, so it should only consider non-missing values.&lt;/P&gt;&lt;P&gt;If you're still encountering issues, double-check if your missing values are properly represented as &lt;CODE&gt;.&lt;/CODE&gt; (for numeric data). You don’t need to modify the &lt;CODE&gt;mean()&lt;/CODE&gt; function; it automatically excludes missing values.&lt;/P&gt;&lt;P&gt;Here’s the correct usage:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;mean(of var1 var2 ...);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To check for missing values, use:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; proc means data=yourdata nmiss;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var var1 var2 ...;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 20:35:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944314#M47160</guid>
      <dc:creator>saiteja_reddy</dc:creator>
      <dc:date>2024-09-17T20:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944329#M47162</link>
      <description>&lt;P&gt;You could replace these missing value with zeros by a simple PROC STDIZE, before using MEAN()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.class;
 if _n_ in (2:8) then call missing(height);
run;

proc stdize data=have out=want missing=0 reponly;
var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 02:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944329#M47162</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-18T02:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944414#M47166</link>
      <description>sorry, my question wasn't clear</description>
      <pubDate>Wed, 18 Sep 2024 13:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944414#M47166</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-09-18T13:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944415#M47167</link>
      <description>sorry, my question wasn't clear</description>
      <pubDate>Wed, 18 Sep 2024 13:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944415#M47167</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-09-18T13:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944420#M47170</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;sorry, my question wasn't clear&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ok,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;, apparently you have received a correct answer, but I have no idea what question it is answering. Could you make that clear?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944420#M47170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-18T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944437#M47172</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;sorry, my question wasn't clear&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ok,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;, apparently you have received a correct answer, but I have no idea what question it is answering. Could you make that clear?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Based on the answer and re-reading the question, OP wants to INCLUDE missing values in the mean function - so he wants to have them considered as 0, but the default behaviour is to exclude these values. He wants them included in the calculations.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944437#M47172</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-09-18T15:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944439#M47173</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;sorry, my question wasn't clear&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ok,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;, apparently you have received a correct answer, but I have no idea what question it is answering. Could you make that clear?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Based on the answer and re-reading the question, OP wants to INCLUDE missing values in the mean function - so he wants to have them considered as 0, but the default behaviour is to exclude these values. He wants them included in the calculations.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is that correct, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;? Treating missings as zeros is a very dangerous thing to do, and should be avoided unless you have very strong subject matter justification for doing so. Anyway, that's up to you, we don't need to discuss it further.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944439#M47173</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-18T15:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to drop the number of missing values in the Mean function?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944450#M47177</link>
      <description>&lt;P&gt;yes, I just wanted to include missing as their request to make some comparison; that's it, not as a final result; you are totally correct; that would be dangerous, thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/how-to-drop-the-number-of-missing-values-in-the-Mean-function/m-p/944450#M47177</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-09-18T15:25:44Z</dc:date>
    </item>
  </channel>
</rss>

