FOCUS AREAS

Categorical Data Analysis: Chapter 1

  

   options nodate nonumber ps=200 ls=80 formdlim=' ';

   data respire;
      input treat $ outcome $ count;
      datalines;
   placebo f 16
   placebo u 48 
   test    f 40 
   test    u 20
   ; 
   proc freq;
      weight count;
      tables treat*outcome;
   run;

   data respire;
      input treat $ outcome $ @@;
      datalines;
   placebo f placebo f  placebo f  
   placebo f placebo f 
   placebo u placebo u  placebo u 
   placebo u placebo u  placebo u 
   placebo u placebo u  placebo u 
   placebo u 
   test    f test    f  test    f 
   test    f test    f  test    f  
   test    f test    f
   test    u test    u  test    u
   test    u test    u  test    u
   test    u test    u  test    u
   test    u test    u  test    u
   test    u test    u  test    u
   test    u test    u  test    u
   test    u test    u 
   ; 
   proc freq;
      tables treat*outcome;
   run;

   data arthrit;           
      length treat $7. sex $6. ;    
      input sex $ treat $ improve $ count @@;
      datalines;  
   female active  marked 16 female active  some 5 female active  none  6
   female placebo marked  6 female placebo some 7 female placebo none 19
   male   active  marked  5 male   active  some 2 male   active  none  7
   male   placebo marked  1 male   placebo some 0 male   placebo none 10
   ; 
   run;

   proc freq order=data;
      weight count;
      tables treat*improve;
   run; 

   proc freq order=data;
      weight count;
      tables sex*treat*improve / nocol nopct;
   run; 


Statistics and Operations Research