<?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: How to assess switch from one value to another in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250538#M47246</link>
    <description>&lt;P&gt;OK. There is only one&amp;nbsp;&lt;SPAN&gt;h_Date for each patient.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id       rx1   $  (rx_date             h_date) (: mmddyy10.); 
format rx_date             h_date mmddyy10.;
cards;
1       a         1/1/2005           1/20/2005
1       b         2/2/2005 .
1       c         3/3/2005 .
2       a         1/2/2003           1/12/2003
2       a         2/2/2003 .
2       a         4/4/2003 .
3       b         1/2/2005           1/18/2005 
3       c         2/3/2005 .
3       b         3/4/2005 .
;
run;
data temp;
 set have(keep=id rx1 rx_date ) 
     have(keep=id rx1 h_date rename=(h_date=rx_date) where=(rx_date is not missing) in=inb);
 by id rx_date ;
 if inb=0 and lag(inb)=1 or first.id;
run;
proc sql;
select * 
 from temp
  group by id
   having count(distinct rx1) gt 1
    order by id,rx_date ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Feb 2016 08:36:33 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-02-17T08:36:33Z</dc:date>
    <item>
      <title>How to assess switch from one value to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250493#M47232</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id       rx1     rx_date             h_date 
1       a         1/1/2005           1/20/2005
1       b         2/2/2005
1       c         3/3/2005
2       a         1/2/2003           1/12/2003
2       a         2/2/2003
2       a         4/4/2003
3       b         1/2/2005           1/18/2005 &lt;BR /&gt;3       c         2/3/2005
3       b         3/4/2005&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a data similar to this. Patients can have multiple drug therapy rx1 in the same rx_Date or in different rx_date, I wanted to assess the patterns of change. For example I wanted to know how many patients switched one drug to another after h_date. Patient 1 was on a then after h_Date switched to b, patient 2 was on a and cont on a after h_Date.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250493#M47232</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-02-17T03:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to assess switch from one value to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250495#M47234</link>
      <description>&lt;P&gt;Your data is not completed . There are lots of missing value .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what &lt;STRONG&gt;output&lt;/STRONG&gt; do you want ?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250495#M47234</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-17T03:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to assess switch from one value to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250498#M47235</link>
      <description>&lt;P&gt;There is only 1 h_date per patient. I want the proprtion of patient who change rx1 (in a time period of 30 days) after h_date&lt;/P&gt;&lt;P&gt;proprtion of those who remain on a after h_date (patient 2), those who change from a to b (patient a) and so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250498#M47235</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-02-17T03:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to assess switch from one value to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250538#M47246</link>
      <description>&lt;P&gt;OK. There is only one&amp;nbsp;&lt;SPAN&gt;h_Date for each patient.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id       rx1   $  (rx_date             h_date) (: mmddyy10.); 
format rx_date             h_date mmddyy10.;
cards;
1       a         1/1/2005           1/20/2005
1       b         2/2/2005 .
1       c         3/3/2005 .
2       a         1/2/2003           1/12/2003
2       a         2/2/2003 .
2       a         4/4/2003 .
3       b         1/2/2005           1/18/2005 
3       c         2/3/2005 .
3       b         3/4/2005 .
;
run;
data temp;
 set have(keep=id rx1 rx_date ) 
     have(keep=id rx1 h_date rename=(h_date=rx_date) where=(rx_date is not missing) in=inb);
 by id rx_date ;
 if inb=0 and lag(inb)=1 or first.id;
run;
proc sql;
select * 
 from temp
  group by id
   having count(distinct rx1) gt 1
    order by id,rx_date ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Feb 2016 08:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/250538#M47246</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-17T08:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to assess switch from one value to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/251513#M47538</link>
      <description>Thank you!</description>
      <pubDate>Mon, 22 Feb 2016 10:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assess-switch-from-one-value-to-another/m-p/251513#M47538</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-02-22T10:45:12Z</dc:date>
    </item>
  </channel>
</rss>

