<?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: Filling in Missing Data in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152152#M1828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can turn them into numeric by dropping the $ on the read. You'll get warnings but that's okay. Then the story is to replace MISSING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any chance that the sum of percents will already equal 1 and still have a NULL value within the group?&lt;BR /&gt;Assuming percent is numeric:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=have nway;&lt;BR /&gt; class month;&lt;BR /&gt; var percent;&lt;BR /&gt; output out=summary (drop=_type_ _freq_) sum=PctSum Nmiss=NumberMissing;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data addpct;&lt;BR /&gt; set summary;&lt;BR /&gt; If missing(pctsum) then pctsum=0;&lt;BR /&gt; NewPct = (1-pctsum)/NumberMissing;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt; merge have addpct (keep=month newpct);&lt;BR /&gt; by month;&lt;BR /&gt; if missing(percent) then percent = NewPct;&lt;BR /&gt; drop newpct;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 15:19:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-06-23T15:19:25Z</dc:date>
    <item>
      <title>Filling in Missing Data</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152151#M1827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data that takes the following form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input month percent $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 .1&lt;/P&gt;&lt;P&gt;1 .3&lt;/P&gt;&lt;P&gt;1 NULL&lt;/P&gt;&lt;P&gt;1 NULL&lt;/P&gt;&lt;P&gt;1 NULL&lt;/P&gt;&lt;P&gt;2 .1&lt;/P&gt;&lt;P&gt;2 NULL&lt;/P&gt;&lt;P&gt;2 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;3 NULL&lt;/P&gt;&lt;P&gt;4 .1&lt;/P&gt;&lt;P&gt;4 .5&lt;/P&gt;&lt;P&gt;4 NULL&lt;/P&gt;&lt;P&gt;4 NULL&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to fill in all of the data that is stored as NULL (char) with an equal-weighted percent that makes all of the percentages per month add to 1.&amp;nbsp; So for the first month, all three NULL entries would become .2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that I am going to have to turn the character variables into numeric variables, and I can change all of the NULL entries to zero without worry, because there are no entries that are 0 in the dataset, so I won't be losing data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this something that I can use PROC STANDARD for?&amp;nbsp; I have only used that for setting the mean and the SD before, but maybe this can work here too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152151#M1827</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-06-23T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Missing Data</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152152#M1828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can turn them into numeric by dropping the $ on the read. You'll get warnings but that's okay. Then the story is to replace MISSING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any chance that the sum of percents will already equal 1 and still have a NULL value within the group?&lt;BR /&gt;Assuming percent is numeric:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=have nway;&lt;BR /&gt; class month;&lt;BR /&gt; var percent;&lt;BR /&gt; output out=summary (drop=_type_ _freq_) sum=PctSum Nmiss=NumberMissing;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data addpct;&lt;BR /&gt; set summary;&lt;BR /&gt; If missing(pctsum) then pctsum=0;&lt;BR /&gt; NewPct = (1-pctsum)/NumberMissing;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt; merge have addpct (keep=month newpct);&lt;BR /&gt; by month;&lt;BR /&gt; if missing(percent) then percent = NewPct;&lt;BR /&gt; drop newpct;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152152#M1828</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-23T15:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Missing Data</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152153#M1829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! There is no worries about there being a NULL and the percent already adding up to 1.&amp;nbsp; I am just using this as an assumption that I will explain in my analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152153#M1829</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-06-23T15:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filling in Missing Data</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152154#M1830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data have;
input month percent $;
cards;
1 .1
1 .3
1 NULL
1 NULL
1 NULL
2 .1
2 NULL
2 NULL
3 NULL
3 NULL
3 NULL
3 NULL
3 NULL
3 NULL
3 NULL
4 .1
4 .5
4 NULL
4 NULL
;
run;
proc sort data=have; by month percent;run;
data want(drop=x n) ;
x=1; n=0;
 do until(last.month);
&amp;nbsp; set have;
&amp;nbsp; by month;
&amp;nbsp; if not missing(input(percent,?? best8.)) then x=x-percent;
&amp;nbsp;&amp;nbsp; else n+1;
 end;
 do until(last.month);
&amp;nbsp; set have;
&amp;nbsp; by month;
&amp;nbsp; if percent ='NULL' then wt=divide(x,n);
&amp;nbsp;&amp;nbsp; else wt=input(percent, best8.);
&amp;nbsp;&amp;nbsp; output;
end;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Filling-in-Missing-Data/m-p/152154#M1830</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-06-24T13:41:25Z</dc:date>
    </item>
  </channel>
</rss>

