<?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: Delete cases who don't have before and after readings in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301156#M63700</link>
    <description>&lt;P&gt;Thank you PG , I used it and it worked .&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2016 04:44:22 GMT</pubDate>
    <dc:creator>Jordani</dc:creator>
    <dc:date>2016-09-28T04:44:22Z</dc:date>
    <item>
      <title>Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301148#M63696</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a longitudinal data on Patients with hypertension &amp;nbsp;receiving&amp;nbsp;a certain treatment. I would include the patient in the analysis , if and only if, he has two readings of blood pressure , one before treatment and one after. The data look like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; BloodPressure &amp;nbsp; Time&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;110 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Before&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; After &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 98 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; After&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;After&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 89 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;After&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Before&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;97 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; After&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; before &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 98 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Before&amp;nbsp;&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 89 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;After&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see , Pateints number 2 and 4 Will not be included as they don't have readings before and after. Patient number 5 will also be deleted as he only have one reading&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only managed to delete cases with one reading using the command .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data new ;&lt;/P&gt;&lt;P&gt;set Have;&lt;/P&gt;&lt;P&gt;By ID;&lt;/P&gt;&lt;P&gt;If FIRST.ID and LAST.ID then delete;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions &amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 03:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301148#M63696</guid>
      <dc:creator>Jordani</dc:creator>
      <dc:date>2016-09-28T03:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301155#M63699</link>
      <description>&lt;P&gt;Use a SQL query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID     BloodPressure   Time :$8.;
datalines;
1        110                    Before
1         90                     After          
1         98                     After
2         90                      After
2         89                      After
3         95                      Before
3          97                     After
4          100                   before   
4           98                    Before 
5           89                    After 
;

proc sql;
create table want as
select * from have
group by ID
having count(distinct upcase(time)) &amp;gt; 1;
select * from want;
quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Sep 2016 04:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301155#M63699</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-09-28T04:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301156#M63700</link>
      <description>&lt;P&gt;Thank you PG , I used it and it worked .&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 04:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301156#M63700</guid>
      <dc:creator>Jordani</dc:creator>
      <dc:date>2016-09-28T04:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301367#M63758</link>
      <description>&lt;P&gt;Be advised that the code that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&amp;nbsp;provided counts levels not values. If for some reason you end up with something like Atfer, Bfeore or other spellings or words like missing then it well include those.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 17:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301367#M63758</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-28T17:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301375#M63763</link>
      <description>&lt;P&gt;Yeah. I guess that counting DISTINCT UPCASE(&lt;FONT color="#800000"&gt;FIRST&lt;/FONT&gt;(time)) would be a bit more robust.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 18:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301375#M63763</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-09-28T18:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete cases who don't have before and after readings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301384#M63767</link>
      <description>&lt;P&gt;I have done both of them and end with same results. I created the Time variable myself, so I would not expect to have misspellings or errors. However, it's a valuable advice , I will&amp;nbsp;take it into consideration in &amp;nbsp;other analyses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 19:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-cases-who-don-t-have-before-and-after-readings/m-p/301384#M63767</guid>
      <dc:creator>Jordani</dc:creator>
      <dc:date>2016-09-28T19:35:12Z</dc:date>
    </item>
  </channel>
</rss>

