<?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 out missing values in different scenarios in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836709#M36103</link>
    <description>Thank you, sbxkoenk! I like how you partition the data into start missing and startnonmissing, smart and easy to follow. I have never used proc timedata, might you be willing to show how it's done to produce the same output?</description>
    <pubDate>Tue, 04 Oct 2022 13:49:17 GMT</pubDate>
    <dc:creator>hellorc</dc:creator>
    <dc:date>2022-10-04T13:49:17Z</dc:date>
    <item>
      <title>Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836539#M36077</link>
      <description>&lt;P&gt;Closed&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 18:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836539#M36077</guid>
      <dc:creator>hellorc</dc:creator>
      <dc:date>2022-10-03T18:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836561#M36080</link>
      <description>&lt;P&gt;Something like this ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC DATASETS LIBRARY=WORK NoList memtype=DATA;
 delete have: ; run;&lt;BR /&gt; delete want  ; run;
QUIT;

data work.have;
input id hospital $ weight;
datalines;
1 A 55
1 B .
1 C 58
1 D .
1 E 59
2 A .
2 C .
2 F 65
2 G 69
3 B .
3 C 70
3 F .
4 C .
4 D .
;
run;

data work.startmissing   (keep=id) 
     work.startnonmissing(keep=id);
 set work.have;
 by id;
 if first.id then do;
  if weight = . then output work.startmissing;
  else               output work.startnonmissing;
 end;
run;

PROC SQL noprint;
 create table work.have1M as
 select * from work.have
 where id IN (select id from work.startmissing   )
 order by id , hospital desc;
 create table work.have2NM as
 select * from work.have
 where id IN (select id from work.startnonmissing)
 order by id , hospital ;
QUIT;

PROC EXPAND data=work.have1M 
             out=work.have1M_expout
			METHOD=STEP EXTRAPOLATE;
BY id; 
CONVERT weight = weightexp ; 
*ID hospital;
run; QUIT;
proc sort data=work.have1M_expout; by id hospital; run;
PROC EXPAND data=work.have2NM 
             out=work.have2NM_expout
			METHOD=STEP EXTRAPOLATE;
BY id; 
CONVERT weight = weightexp ; 
*ID hospital;
run; QUIT;
/* end of program */ 

PROC APPEND base=work.want data=work.have1M_expout ;
PROC APPEND base=work.want data=work.have2NM_expout;
PROC SORT data=work.want; by id hospital; run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 18:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836561#M36080</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-10-03T18:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836704#M36102</link>
      <description>&lt;P&gt;Thanks for marking my response as the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However ...&lt;/P&gt;
&lt;P&gt;Keep in mind that this programme is entirely based on a missing value in the first record (for and id) or not.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;if no, missing value imputation is always done with the previous value&lt;/LI&gt;
&lt;LI&gt;If yes, missing value imputation is always done with the next value (previous value on the data in reverse order)&lt;BR /&gt;STEP function in PROC EXPAND is used for these imputations.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With PROC TIMEDATA, you can set up mechanisms that are more intelligent.&lt;BR /&gt;PROC TIMEDATA is like a data step for time series data. You can look ahead to "future" records.&lt;BR /&gt;Entire time series (for a by-group) is taken in memory and at every time point t&lt;/P&gt;
&lt;P&gt;, you have access to [ t - i ] AND ALSO to [ t + j ].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 13:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836704#M36102</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-10-04T13:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836709#M36103</link>
      <description>Thank you, sbxkoenk! I like how you partition the data into start missing and startnonmissing, smart and easy to follow. I have never used proc timedata, might you be willing to show how it's done to produce the same output?</description>
      <pubDate>Tue, 04 Oct 2022 13:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836709#M36103</guid>
      <dc:creator>hellorc</dc:creator>
      <dc:date>2022-10-04T13:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836809#M36108</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431043"&gt;@hellorc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431043"&gt;@hellorc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have never used proc timedata, might you be willing to show how it's done to produce the same output?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I will try to do that before the weekend.&lt;BR /&gt;&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 20:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836809#M36108</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-10-04T20:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filling out missing values in different scenarios</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836811#M36110</link>
      <description>&lt;P&gt;Is there a reason you are deleting your questions after answered?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They will be marked as solved, but if you delete them the thread becomes fairly useless to everyone else. Please do not delete your questions after they've been answered. It doesn't appear as if you're posting confidential data so that should not be an issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 20:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filling-out-missing-values-in-different-scenarios/m-p/836811#M36110</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-04T20:47:23Z</dc:date>
    </item>
  </channel>
</rss>

