Help with data #10

  • Follow


I have the following data:
Dose

Dose data

P_ID  dose_DATE
001 01Jan2003
001 02Jan2003
002 15Mar2003
002 01Mar2003
003 01Apr2003
004 19Mar2003


AE  data

P_ID    AE_Strt_date AE_Text

001     01Dec2002    Headache
001     02Jan2003    Blurry Vision
001     02Jan2003    Anxiety
002     02Mar2003    Migraine
002     01Mar2003    Constipation
002     15Mar2004    Athlete=E2=80=99s Foot
003     02Apr2003    Depression
003     02Apr2003    Rash


Final output I need as follows

P_ID   Dose Date AE_Strt_date AE_Text
001    01Jan2003 02Jan2003    Blurry Vision
001    01Jan2003 02Jan2003    Anxiety
002    01Mar2003 01Mar2003    Constipation
002    01Mar2003 02Mar2003    Migraine
003    01Apr2003 02Apr2003    Depression
003    01Apr2003 02Apr2003    Rash

The Final dataset should include adverse events that occurred on a dosing d=
ate or 1 day after a dosing date.
=20

I tried following SQL code but did not get the output as needed.


proc sql;
 create table alldata2 as
 select a.*,b.ae_strt_date, b.ae_text
    from dose a
	inner join ae b on=20
	a.p_id =3D b.p_id
  and b.ae_strt_date  >=3D a.dose_date ;
quit;
run;
=20
I would appreciate any help in this.

0
Reply ppds737 (10) 8/18/2012 8:33:34 AM

Patient 001 had two dose dates (1Jan and 2Jan) for which the adverse
reactions (in observations 2 and 3) met your selection criteria. Why
is only one of those dates (1Jan) in your output?  

On Sat, 18 Aug 2012 01:33:34 -0700 (PDT), ppds737@gmail.com wrote:

>I have the following data:
>Dose
>
>Dose data
>
>P_ID  dose_DATE
>001 01Jan2003
>001 02Jan2003
>002 15Mar2003
>002 01Mar2003
>003 01Apr2003
>004 19Mar2003
>
>
>AE  data
>
>P_ID    AE_Strt_date AE_Text
>
>001     01Dec2002    Headache
>001     02Jan2003    Blurry Vision
>001     02Jan2003    Anxiety
>002     02Mar2003    Migraine
>002     01Mar2003    Constipation
>002     15Mar2004    Athlete’s Foot
>003     02Apr2003    Depression
>003     02Apr2003    Rash
>
>
>Final output I need as follows
>
>P_ID   Dose Date AE_Strt_date AE_Text
>001    01Jan2003 02Jan2003    Blurry Vision
>001    01Jan2003 02Jan2003    Anxiety
>002    01Mar2003 01Mar2003    Constipation
>002    01Mar2003 02Mar2003    Migraine
>003    01Apr2003 02Apr2003    Depression
>003    01Apr2003 02Apr2003    Rash
>
>The Final dataset should include adverse events that occurred on a dosing date or 1 day after a dosing date.
> 
>
>I tried following SQL code but did not get the output as needed.
>
>
>proc sql;
> create table alldata2 as
> select a.*,b.ae_strt_date, b.ae_text
>    from dose a
>	inner join ae b on 
>	a.p_id = b.p_id
>  and b.ae_strt_date  >= a.dose_date ;
>quit;
>run;
> 
>I would appreciate any help in this.

-- 
Remove del for email
0
Reply schwarzb3978 (1358) 8/18/2012 6:33:43 PM


1 Replies
26 Views

(page loaded in 0.048 seconds)


Reply: