<?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: create a random date in the control group based on a date from treatment group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804774#M316962</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69937"&gt;@lillymaginta1&lt;/a&gt;&amp;nbsp;wrote:&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;
&lt;P&gt;2) if step 1 is correct, then randomly select one patient from drug=1 who met the criteria&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does this mean? How would I know if it is correct? What does "correct" mean in this context?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Patient in drug=0 group (example patient 4) first_Date is within the same month and year of a patient in drug=1 group.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if there are no matches? What happens if there are multiple matches?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2022 14:12:30 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-03-29T14:12:30Z</dc:date>
    <item>
      <title>create a random date in the control group based on a date from treatment group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804757#M316955</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards ;
input ID drug interval   (first_Date drug_Date) (: mmddyy10.) ;	 
cards;
001 1  4 1/1/2004  1/5/2004
002 1 5 4/5/2004  4/10/2004
003 1 14 6/1/2005 6/15/2009
004 0 .    1/4/2010     . 
005 0 .    4/5/2010     . 
006 0 .    6/5/2010     .
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have data with two groups: a) treatment group with first date and drug_Date, and b)control group with first_Date only. I want to create drug_date in the control group based on the interval variable which equal drug_Date- first_Date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example output for the control group (where drug=0)&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;004 0 4    1/4/2010     1/8/2010 
005 0 5    4/5/2010     4/10/2010 
006 0 14    6/5/2010     6/19/2010&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 13:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804757#M316955</guid>
      <dc:creator>lillymaginta1</dc:creator>
      <dc:date>2022-03-29T13:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: create a random date in the control group based on a date from treatment group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804759#M316957</link>
      <description>&lt;P&gt;I'm not sure how you intend to do this. Does line 1 match with line 4? Or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you walk us through the steps you have in mind in words (instead of using SAS code)?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 13:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804759#M316957</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-29T13:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: create a random date in the control group based on a date from treatment group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804767#M316961</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;001 1  4 1/1/2004  1/5/2004
002 1 5 4/5/2004  4/10/2004
003 1 14 6/1/2005 6/15/2009
004 0 .    1/4/2010     . 
005 0 .    4/5/2010     . 
006 0 .    6/5/2010     .&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The difference between line 1 and line 4 is that each one correspond to a different treatment group.&lt;/P&gt;
&lt;P&gt;Here is a hypothetical steps:&lt;/P&gt;
&lt;P&gt;1) Patient in drug=0 group (example patient 4) first_Date is within the same month and year of a patient in drug=1 group.&lt;/P&gt;
&lt;P&gt;2) if step 1 is correct, then randomly select one patient from drug=1 who met the criteria&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) generate drug_Date based on the interval between drug_Date and first_date of the patient selected in step 2 (example patient 3 was selected for patient 4, then the interval= 4)&lt;/P&gt;
&lt;P&gt;4) output for patient 4 would be&amp;nbsp;&lt;CODE class=" language-sas"&gt;6/5/2010 +&amp;nbsp;14= 6/19/2010 &amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804767#M316961</guid>
      <dc:creator>lillymaginta1</dc:creator>
      <dc:date>2022-03-29T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: create a random date in the control group based on a date from treatment group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804774#M316962</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69937"&gt;@lillymaginta1&lt;/a&gt;&amp;nbsp;wrote:&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;
&lt;P&gt;2) if step 1 is correct, then randomly select one patient from drug=1 who met the criteria&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does this mean? How would I know if it is correct? What does "correct" mean in this context?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Patient in drug=0 group (example patient 4) first_Date is within the same month and year of a patient in drug=1 group.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if there are no matches? What happens if there are multiple matches?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804774#M316962</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-29T14:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: create a random date in the control group based on a date from treatment group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804776#M316963</link>
      <description>&lt;P&gt;Sorry for the confusion, if the condition applies (not correct) then&lt;U&gt; randomly pick&lt;/U&gt; one of the multiple matches from the drug=1 group and generate the date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are no matches, I think generating a drug_Date based on the &lt;U&gt;mean (interval)&lt;/U&gt; of all patient in drug=1 group should be fine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-random-date-in-the-control-group-based-on-a-date-from/m-p/804776#M316963</guid>
      <dc:creator>lillymaginta1</dc:creator>
      <dc:date>2022-03-29T14:16:47Z</dc:date>
    </item>
  </channel>
</rss>

