<?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 a question on cleaning longitudinal data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26293#M6003</link>
    <description>Hello, &lt;BR /&gt;
Please see below is an example of the messy data I have. A member has records for mutiple hospitalizations; for seemingly one hospitalization, there were multiple rows of records with slightly different admission dates and discharge dates.  &lt;BR /&gt;
&lt;BR /&gt;
I hope to clean the data and get one record for one hospitalization. When there are mutiple rows for seemingly one hospitalization because of the overlaping time, create one record with earliest admission date and latest discharge date. &lt;BR /&gt;
&lt;BR /&gt;
Raw data:&lt;BR /&gt;
&lt;BR /&gt;
MemberID admission_date	discharge_date&lt;BR /&gt;
aaaa	 9/11/2007 	9/22/2007&lt;BR /&gt;
aaaa	 9/11/2007 	9/26/2007&lt;BR /&gt;
		&lt;BR /&gt;
aaaa	10/11/2007	10/26/2007&lt;BR /&gt;
		&lt;BR /&gt;
aaaa	4/1/2008	4/14/2008&lt;BR /&gt;
aaaa	4/7/2008 	5/8/2008&lt;BR /&gt;
aaaa	4/17/2008	4/28/2008&lt;BR /&gt;
&lt;BR /&gt;
Hope to clean the data as&lt;BR /&gt;
&lt;BR /&gt;
MemberID admission_date	discharge_date&lt;BR /&gt;
aaaa	 9/11/2007 	9/26/2007&lt;BR /&gt;
aaaa	10/11/2007	10/26/2007&lt;BR /&gt;
aaaa	4/1/2008	5/8/2008&lt;BR /&gt;
&lt;BR /&gt;
I couldn't figure out a way to program this. Does anybody know? Thanks a lot.</description>
    <pubDate>Fri, 01 May 2009 21:14:49 GMT</pubDate>
    <dc:creator>mtao</dc:creator>
    <dc:date>2009-05-01T21:14:49Z</dc:date>
    <item>
      <title>a question on cleaning longitudinal data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26293#M6003</link>
      <description>Hello, &lt;BR /&gt;
Please see below is an example of the messy data I have. A member has records for mutiple hospitalizations; for seemingly one hospitalization, there were multiple rows of records with slightly different admission dates and discharge dates.  &lt;BR /&gt;
&lt;BR /&gt;
I hope to clean the data and get one record for one hospitalization. When there are mutiple rows for seemingly one hospitalization because of the overlaping time, create one record with earliest admission date and latest discharge date. &lt;BR /&gt;
&lt;BR /&gt;
Raw data:&lt;BR /&gt;
&lt;BR /&gt;
MemberID admission_date	discharge_date&lt;BR /&gt;
aaaa	 9/11/2007 	9/22/2007&lt;BR /&gt;
aaaa	 9/11/2007 	9/26/2007&lt;BR /&gt;
		&lt;BR /&gt;
aaaa	10/11/2007	10/26/2007&lt;BR /&gt;
		&lt;BR /&gt;
aaaa	4/1/2008	4/14/2008&lt;BR /&gt;
aaaa	4/7/2008 	5/8/2008&lt;BR /&gt;
aaaa	4/17/2008	4/28/2008&lt;BR /&gt;
&lt;BR /&gt;
Hope to clean the data as&lt;BR /&gt;
&lt;BR /&gt;
MemberID admission_date	discharge_date&lt;BR /&gt;
aaaa	 9/11/2007 	9/26/2007&lt;BR /&gt;
aaaa	10/11/2007	10/26/2007&lt;BR /&gt;
aaaa	4/1/2008	5/8/2008&lt;BR /&gt;
&lt;BR /&gt;
I couldn't figure out a way to program this. Does anybody know? Thanks a lot.</description>
      <pubDate>Fri, 01 May 2009 21:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26293#M6003</guid>
      <dc:creator>mtao</dc:creator>
      <dc:date>2009-05-01T21:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: a question on cleaning longitudinal data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26294#M6004</link>
      <description>Though not scientific, consider using a DATA step and a DO / END loop to generate one observation for each date within the range, then sort the observations in sequence and use the LAG function to compare adjacent observations, and if there is a gap of more than some determined length of days (using the INTCK function), then increment a counter.  Lastly, use PROC SUMMARY to generate a MIN/MAX variable for each hospitalization.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sat, 02 May 2009 19:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26294#M6004</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-02T19:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: a question on cleaning longitudinal data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26295#M6005</link>
      <description>There was actually a paper at this year's Global Forum that covered a very similar topic. &lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/resources/papers/proceedings09/079-2009.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings09/079-2009.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I hope you can find something in here to help.</description>
      <pubDate>Mon, 04 May 2009 16:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/a-question-on-cleaning-longitudinal-data/m-p/26295#M6005</guid>
      <dc:creator>sfleming</dc:creator>
      <dc:date>2009-05-04T16:25:17Z</dc:date>
    </item>
  </channel>
</rss>

