BookmarkSubscribeRSS Feed
devarayalu
Fluorite | Level 6

data ae; 

label subjid  ='Subject Number'

      trt     ='Treatment, 1=Control, 2=Active'

      aebodsys='Body System of Event'

  aedecod ='Preferred Term'

  aerel   ='Relatedness, Y=Related, N=Not Related'

  aeser   ='Seriousness, Y=Yes, N=No'

  aetoxgrd='AE Toxicity Grade'

  death   ='Death, 1=Yes'

  aestdy  ='Start Day of AE Relative to First Dose'

  aeendy  ='End Day of AE Relative to First Dose'

  lstfdy  ='Day of Last Follow-up'

  ;

input subjid $ 1-3 trt 5 aebodsys $ 7-33 aedecod $ 34-58 aerel $ 59 aeser $ 62 

      aetoxgrd 65 death 68 aestdy 70-72 aeendy 73-76 lstfdy 77-79;

cards;

001 2 Nervous system disorders    Dizziness               Y  N  1  . 3  4   56

002 1 Cardiac disorders           Cardiomyopathy          N  N  2  . 5  6   78

002 1 Nervous system disorders    Headache                N  N  2  . 12 13  78

002 1 Vascular disorders          Malignant hypertension  N  N  2  . 2  .   78

002 1 Cardiac disorders           Cardiac valve disease   Y  N  2  . 2  34  78

002 1 Nervous system disorders    Headache                Y  Y  3  . 7  8   78

002 1 Vascular disorders          Hypertension            Y  N  2  . 3  4   78

007 2 Infections and infestations Bronchitis              Y  N  1  . 4  16  92

012 2 Infections and infestations Viral infection         Y  N  1  . 2  9   45

020 2 Eye disorders               Conjunctivitis          N  N  1  . 17 21  83

021 2 Infections and infestations Subcutaneous abscess    N  N  2  . 45 .   92

021 2 Gastrointestinal disorders  Constipation            N  N  2  . 23 24  92

021 2 Renal and urinary disorders Renal failure acute     N  N  2  . 43 50  92

021 2 Infections and infestations Sepsis                  Y  Y  4  . 56 .   92

031 1 Gastrointestinal disorders  Hypoaesthesia oral      Y  N  3  . 3  10  68

032 1 Infections and infestations Tooth abscess           N  N  2  . 2  7   78

038 1 Hepatobiliary disorders     Bile duct stone         N  Y  2  . 33 45  90

040 2 Nervous system disorders    Headache                N  N  1  . 12 13  65

041 2 Nervous system disorders    Dizziness               Y  N  1  . 11 12  65

052 1 Infections and infestations Sinusitis               N  N  1  . 21 34  96

053 1 Infections and infestations Bronchitis              N  N  2  . 4  5   55

053 1 Infections and infestations Sinusitis               N  N  2  . 34 .   55

064 2 Nervous system disorders    Syncope                 N  N  2  . 23 .   87

064 2 Cardiac disorders           Myocardial infarction   N  Y  2  . 45 47  87

065 1 Gastrointestinal disorders  Paraesthesia oral       Y  N  1  1 2  6   20

071 2 Infections and infestations Sinusitis               N  N  2  . 3  16  87

077 1 Nervous system disorders    Headache                N  N  2  . 56 67  83

083 2 Infections and infestations Nasopharyngitis         N  N  1  . 32 .   89

085 1 Cardiac disorders           Atrial fibrillation     N  N  2  . 23 24  65

086 2 Infections and infestations Appendicitis            N  N  2  . 20 27  77

087 1 Eye disorders               Ocular hyperaemia       N  N  2  . 22 56  90

087 1 Eye disorders               Eye swelling            N  N  2  . 12 34  90

088 1 Eye disorders               Eye swelling            Y  N  1  . 56 57  94

091 1 Infections and infestations Bronchitis              N  N  1  . 4  10  89

091 1 Cardiac disorders           Atrial fibrillation     N  Y  3  . 28 30  89

092 1 Infections and infestations Urinary tract infection N  N  1  . 23 26  71

093 1 Infections and infestations Oral herpes             N  N  2  . 12 17  99

093 1 Nervous system disorders    Headache                N  N  1  . 3  5   99

095 2 Infections and infestations Laryngitis              N  N  1  . 66 75  89

095 2 Nervous system disorders    Headache                N  N  1  . 88 89  89

097 1 Infections and infestations Nasopharyngitis         N  N  1  . 45 54  88

097 1 Nervous system disorders    Syncope                 N  N  2  . 23 56  88

099 1 Infections and infestations Diverticulitis          N  N  2  . 4  9   59

099 1 Nervous system disorders    Syncope                 N  N  2  . 21 .   59

103 2 Gastrointestinal disorders  Abdominal pain upper    Y  N  1  . 32 33  78

105 1 Infections and infestations Sinusitis               N  N  2  . 66 .   89

105 1 Infections and infestations Nasopharyngitis         N  N  1  . 45 65  89

;

Required output should be like the following table:

Adverse event        Treatment 1        Treatment 2

                                  (n=17)             (n=13)

Atrial fibrillation          2 (11.7)                   0

Bile duct stone           1 (5.88)                  0

Bronchitis                   2 (11.7)                  1(7.69)

.

.

.

.

.

.

.

Thank you in advance Smiley Happy

2 REPLIES 2
cau83
Pyrite | Level 9

how are you calculating those numbers in the table?

ex what is 2 and what is 11.7 next to atrial fibrillation?

my guess is 2 is the total number of the N=17. I'm not sure about the 11.7. Regardless, the first thing that comes to me is a bit clunky but it will work:

proc sql noprint;

     create table report- as select

          trt,aedocod,count(aedecod) as N, YOUR-CALCULATION-OF-11.7 as Stat

          group by trt, aedecod from dataset;

     select count(trt) into :N1 from dataset where trt=1;

     select count(trt) into :N2 from dataset where trt=2;

quit;

Then a on row data set for your first row of  data:

data N;

     adverseevent="";

     Treatment1="(n=" || &N1. || ")";

     etc.

run;

then a data set that puts them all together

data report2;

     set N report(in=b);

     if b=1 and trt=1 then do;

          adverseevent=aedocod;

          treatment1= trt || "(" || THE-CALCULATED-STATISTIC || ")"

etc.

I don't do a lot of concatenation with the pipes ( || ) and i didn't test everything above so the syntax may not be exactly right but i think that approach of using sql to create a table of statistics, store the treatment group N's into macro variables, then data steps to append and concatenate all those results together will work. someone with more experience with doing direct reporting out of SAS may have something more elegant. If your calculation of 11.7 is more complicated then you  may need to have some other proc or data step first to get that out.

Cynthia_sas
SAS Super FREQ

Hi:

Haven't you posted almost this exact same question in this forum?

  So, my question to you is what did the several answers to the previous question help you with? How is this question different from your first question? And, what code (beyond reading the data) have you tried? What procedures have you used to solve this problem?

cynthia

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 743 views
  • 0 likes
  • 3 in conversation