<?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: Using proc means output in datastep in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733623#M28588</link>
    <description>&lt;P&gt;With Proc SQL using self join and Coalesce function it's pretty easy to this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 05:21:35 GMT</pubDate>
    <dc:creator>Aku</dc:creator>
    <dc:date>2021-04-14T05:21:35Z</dc:date>
    <item>
      <title>Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733592#M28584</link>
      <description>I calculated the median using proc means and I would like to know how to use the median output from proc means in datastep to impute the missing values.&lt;BR /&gt;Using the output option creates a dataset and using set in the step is not what I intend. Is there anyway that single value can be used ?</description>
      <pubDate>Wed, 14 Apr 2021 03:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733592#M28584</guid>
      <dc:creator>Axsta</dc:creator>
      <dc:date>2021-04-14T03:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733594#M28585</link>
      <description>&lt;P&gt;Since proc means is a procedure for calculating basic statistics, I don't think it has the function to rewrite the original data set.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 03:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733594#M28585</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-14T03:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733609#M28586</link>
      <description>&lt;P&gt;If you want to manipulate data having it in datasets is the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the goal is just to replace the missing values with the MEDIAN then just skip PROC MEANS and use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_stdize_syntax01.htm#statug.stdize.missingopt" target="_self"&gt;PROC STDIZE&lt;/A&gt; with METHOD=MEDIAN and MISSING=REPLACE.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733609#M28586</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-14T04:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733620#M28587</link>
      <description>&lt;P&gt;If you don't want to use proc stdsize, merging the result of proc means with the original dataset could be an option.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733620#M28587</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-04-14T04:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733623#M28588</link>
      <description>&lt;P&gt;With Proc SQL using self join and Coalesce function it's pretty easy to this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 05:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733623#M28588</guid>
      <dc:creator>Aku</dc:creator>
      <dc:date>2021-04-14T05:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733741#M28593</link>
      <description>&lt;P&gt;For an example of using PROC STDIZE to impute by using the median, see the article &lt;A href="https://blogs.sas.com/content/iml/2017/12/04/mean-imputation-sas.html" target="_self"&gt;"Mean imputation in SAS,"&lt;/A&gt; which mentions the&amp;nbsp;&lt;SPAN&gt;METHOD=MEDIAN option.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can also get the value from PROC MEANS by reading it into a macro variable, but it requires more effort and more steps:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.heart N NMISS MEDIAN stackods;
   var Cholesterol;
   ods output Summary=MedianOut;
run;

data _NULL_;
set MedianOut;
call symputx("Median", Median);
run;
 
%put &amp;amp;=Median;

data Impute;
set sashelp.heart;
if missing(Cholesterol) then 
   Cholesterol = &amp;amp;Median;
run;

proc means data=Impute N NMISS MEDIAN;
   var Cholesterol;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Apr 2021 13:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733741#M28593</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-04-14T13:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733767#M28594</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/320898"&gt;@Axsta&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I calculated the median using proc means and I would like to know how to use the median output from proc means in datastep to impute the missing values.&lt;BR /&gt;Using the output option creates a dataset and using set in the step is not what I intend. Is there anyway that single value can be used ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since there at least two different methods to create a data set as output from Proc Means and they can have different structures depending on options chosen, the first thing you should do is show the Proc Means code used to generate the output data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Impute the missing values where? In the result of proc means? A different data set? Single value of what?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 14:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/733767#M28594</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-14T14:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc means output in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/734188#M28614</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Axsta_0-1618484457267.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57846iDBDF0040977CD41F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Axsta_0-1618484457267.png" alt="Axsta_0-1618484457267.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am preparing myself for the base sas programming specialist exam and this was one of the questions in them. I am not sure if they require you to use advanced macros and call symput.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 11:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-proc-means-output-in-datastep/m-p/734188#M28614</guid>
      <dc:creator>Axsta</dc:creator>
      <dc:date>2021-04-15T11:03:32Z</dc:date>
    </item>
  </channel>
</rss>

