<?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: missing value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10077#M902</link>
    <description>Patrick, &lt;BR /&gt;
my data like this:&lt;BR /&gt;
id     year    age &lt;BR /&gt;
100   2005      . &lt;BR /&gt;
100   2006      . &lt;BR /&gt;
100   2007      25 &lt;BR /&gt;
 101  2005      . &lt;BR /&gt;
101   2006      28&lt;BR /&gt;
101   2007      29&lt;BR /&gt;
102   2005      35&lt;BR /&gt;
102   2006      36&lt;BR /&gt;
102   2007      37&lt;BR /&gt;
Thanks

Message was edited by: vietst</description>
    <pubDate>Sat, 31 Oct 2009 06:41:44 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-10-31T06:41:44Z</dc:date>
    <item>
      <title>missing value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10075#M900</link>
      <description>some of my interviewees do not supply information &lt;BR /&gt;
about their age at the first few interviews. How can I use the latter &lt;BR /&gt;
information of their age to replace the information of their earlier &lt;BR /&gt;
age. (interviews are conducted one time each year). &lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 30 Oct 2009 22:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10075#M900</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-30T22:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: missing value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10076#M901</link>
      <description>I assume you would best save both date of interview and date of birth in your data - and then just replace the missing DoB in your older data via a merge over the id.&lt;BR /&gt;
&lt;BR /&gt;
You should provide an example with sample data if you need a more specific answer.</description>
      <pubDate>Fri, 30 Oct 2009 23:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10076#M901</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-10-30T23:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: missing value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10077#M902</link>
      <description>Patrick, &lt;BR /&gt;
my data like this:&lt;BR /&gt;
id     year    age &lt;BR /&gt;
100   2005      . &lt;BR /&gt;
100   2006      . &lt;BR /&gt;
100   2007      25 &lt;BR /&gt;
 101  2005      . &lt;BR /&gt;
101   2006      28&lt;BR /&gt;
101   2007      29&lt;BR /&gt;
102   2005      35&lt;BR /&gt;
102   2006      36&lt;BR /&gt;
102   2007      37&lt;BR /&gt;
Thanks

Message was edited by: vietst</description>
      <pubDate>Sat, 31 Oct 2009 06:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10077#M902</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-31T06:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: missing value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10078#M903</link>
      <description>Try this simple sample&lt;BR /&gt;
&lt;BR /&gt;
data input;&lt;BR /&gt;
  input id year age ;&lt;BR /&gt;
  datalines;&lt;BR /&gt;
100 2005 . &lt;BR /&gt;
100 2006 . &lt;BR /&gt;
100 2007 25 &lt;BR /&gt;
101 2005 . &lt;BR /&gt;
101 2006 28&lt;BR /&gt;
101 2007 29&lt;BR /&gt;
102 2005 35&lt;BR /&gt;
102 2006 36&lt;BR /&gt;
102 2007 37&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=input;&lt;BR /&gt;
  by id descending year age;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data output;&lt;BR /&gt;
  retain Rage;&lt;BR /&gt;
  set input;&lt;BR /&gt;
  by id;&lt;BR /&gt;
  if age ne . then Rage=age;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You will need to implement some testing - i.e. what to do if the latest obs for an id is also missing age etc. etc. But I hope the above code will get you started in writing the code that will solve your problem.</description>
      <pubDate>Tue, 03 Nov 2009 12:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10078#M903</guid>
      <dc:creator>GertNissen</dc:creator>
      <dc:date>2009-11-03T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: missing value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10079#M904</link>
      <description>Here is another sollution for you.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data one;&lt;BR /&gt;
input id year age ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
100 2005 .&lt;BR /&gt;
100 2006 .&lt;BR /&gt;
100 2007 25&lt;BR /&gt;
101 2005 .&lt;BR /&gt;
101 2006 28&lt;BR /&gt;
101 2007 29&lt;BR /&gt;
102 2005 35&lt;BR /&gt;
102 2006 36&lt;BR /&gt;
102 2007 37&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
 proc sort data = one;&lt;BR /&gt;
   by id year;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
 data age;&lt;BR /&gt;
set one (where = (aage ne .) rename = (year = ayear age = aage));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data two (drop = aage ayear);&lt;BR /&gt;
  merge one age;&lt;BR /&gt;
  by id;&lt;BR /&gt;
  if age = . then age = aage - (ayear - year);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 09 Nov 2009 17:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-value/m-p/10079#M904</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-11-09T17:32:34Z</dc:date>
    </item>
  </channel>
</rss>

