<?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: Why doesn't proc stdize replace missing values? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779343#M248190</link>
    <description>&lt;P&gt;Did you tell it to replace missing values?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You told it NOT to standardize by using REPONLY.&amp;nbsp; But then did not tell it to replace the missing values by using MISSING=.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_stdize_syntax01.htm#statug.stdize.missingopt" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_stdize_syntax01.htm#statug.stdize.missingopt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 14:39:03 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-11-09T14:39:03Z</dc:date>
    <item>
      <title>Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779305#M248164</link>
      <description>&lt;P&gt;Does anyone see an obvious reason why this doesn't work? There are no errors or warnings in the log, but none of the missing values are being imputed. Is there any easier way to impute them?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sort data=msrp; 
     by use model_name; 
run;

proc stdize data=msrp out=msrp2 reponly method=mean;
	by use model_name;
	var msrp;
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779305#M248164</guid>
      <dc:creator>kz_</dc:creator>
      <dc:date>2021-11-09T12:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779308#M248165</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see an obvious error in your code / syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you are having by-groups with only missing values. In that case, no location measure can be calculated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779308#M248165</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-09T12:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779310#M248166</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322176"&gt;@kz_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Does anyone see an obvious reason why this doesn't work? There are no errors or warnings in the log, but none of the missing values are being imputed. Is there any easier way to impute them?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sort data=msrp; 
     by use model_name; 
run;

proc stdize data=msrp out=msrp2 reponly method=mean;
	by use model_name;
	var msrp;
run;
&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is my experience that PROC STDIZE does replace missing values. So you need to show us (a portion of) the data you are using, and the output where it appears the missings are not replaced.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779310#M248166</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-09T12:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779311#M248167</link>
      <description>I already checked and that is not the case, so I can calculate the mean of the by groups and 'manually' impute, but that seems like a pain.</description>
      <pubDate>Tue, 09 Nov 2021 12:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779311#M248167</guid>
      <dc:creator>kz_</dc:creator>
      <dc:date>2021-11-09T12:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779312#M248168</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322176"&gt;@kz_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I already checked and that is not the case, so I can calculate the mean of the by groups and 'manually' impute, but that seems like a pain.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us your data.&amp;nbsp;Show us what you see. Simply stating it isn't working will not ever be enough for us to help you solve the problem.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779312#M248168</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-09T12:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779322#M248176</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data heart;
 set sashelp.heart;
 call streaminit(1);
 if rand('bern',0.4) then call missing(height,weight);

proc sort data=heart; 
     by sex; 
run;

proc stdize data=heart out=msrp2 reponly missing=mean;
	by sex;
	var weight height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 13:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779322#M248176</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-09T13:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779343#M248190</link>
      <description>&lt;P&gt;Did you tell it to replace missing values?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You told it NOT to standardize by using REPONLY.&amp;nbsp; But then did not tell it to replace the missing values by using MISSING=.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_stdize_syntax01.htm#statug.stdize.missingopt" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_stdize_syntax01.htm#statug.stdize.missingopt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779343#M248190</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-09T14:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779351#M248191</link>
      <description>&lt;P&gt;It cannot replace the missing with the MEAN if there are no non-missing values.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
 set sashelp.class ;
 if sex='M' then height=.;
 if name=:'A' then weight=.;
run;
proc sort;
  by sex name;
run;

proc stdize data=class out=class1 reponly method=mean;
  by sex;
  var height weight;
run;

proc compare data=class compare=class1;
  id sex name;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 15:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779351#M248191</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-09T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779353#M248192</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Giving feedback on your 2 posts above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Method= option should be sufficient to replace missings with REPONLY. You do not need missing= option.&lt;/P&gt;
&lt;P&gt;From the doc :&lt;/P&gt;
&lt;DIV class="xisDoc-refProc"&gt;
&lt;DIV id="statug.stdize.stdizeproc" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;MISSING=&lt;SPAN class=" aa-argument"&gt;method&lt;/SPAN&gt;&amp;nbsp;|&amp;nbsp;&lt;SPAN class=" aa-argument"&gt;value&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;specifies the method (or a numeric value) for replacing missing values. If you omit the MISSING= option, the REPLACE option replaces missing values with the location measure given by the METHOD= option. Specify the MISSING= option when you want to replace missing values with a different value. You can specify any name that is valid in the METHOD= option except the name IN. The corresponding location measure is used to replace missing values.&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;If a numeric value is given, the value replaces missing values after standardizing the data. However, you can specify the REPONLY option with the MISSING= option to suppress standardization for cases in which you want only to replace missing values.&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;Secondly ,&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322176"&gt;@kz_&lt;/a&gt;&amp;nbsp;claims he / she did already check for missing values. Each by-group seems to have valid values he / she says.&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;Thanks,&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;Koen&lt;/P&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Nov 2021 15:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779353#M248192</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-09T15:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't proc stdize replace missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779363#M248193</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have some levels of the variable Model_name&amp;nbsp; without any values for specific Use variable values then the location measure does not exist for that by group. So there is nothing to use for imputing within that by group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check for that condition with&lt;/P&gt;
&lt;PRE&gt;Proc freq data=msrp;
   tables use*model_name / list missing;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 15:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesn-t-proc-stdize-replace-missing-values/m-p/779363#M248193</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-09T15:48:01Z</dc:date>
    </item>
  </channel>
</rss>

