Resources

SASŪ High-Performance Analytics Samples

The SAS High-Performance Analytics sample programs and install verification tests can be run only after you edit and submit this file. The file contains site-specific information about your environment so that the procedures can run successfully.

Example 4 for PROC HPLOGISTIC

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: hploge04                                            */
/*   TITLE: Example 4 for PROC HPLOGISTIC                       */
/* PRODUCT: HPA                                                 */
/*  SYSTEM: ALL                                                 */
/*    KEYS: logistic regression analysis,                       */
/*          conditional logistic regression analysis,           */
/*          binomial response data,                             */
/*   PROCS: HPLOGISTIC                                          */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: Bob Derr                                            */
/*     REF: SAS/STAT User's Guide, PROC HPLOGISTIC chapter      */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

/*****************************************************************
Example 4: Conditional Logistic Regression for Matched Pairs Data
****************************************************************/

/* The data are a subset of data from the Los Angeles Study of the
Endometrial Cancer Data described in Breslow and Day (1980).  There
are 63 matched pairs, each consisting of a case of endometrial
cancer (Outcome=1) and a control (Outcome=0).  The case and the
corresponding control have the same ID.  The explanatory variables
include Gall (an indicator for gall bladder disease) and Hyper (an
indicator for hypertension).  The goal of the analysis is to
determine the relative risk for gall bladder disease controlling
for the effect of hypertension.

When each matched set consists of one event and one non-event you
can transform each matched pair into a single observation, where
the variables Gall and Hyper contain the differences between the
corresponding values for the case and the control.  The variable
Outcome, which is used as the response variable in the logistic
regression model, is given a constant value of 0.

PROC HPLOGISTIC is invoked with the NOINT option to obtain the
conditional logistic model estimates.  The model contains GALL as
the only predictor variable.  The CL option is also specified, to
obtain 95\% confidence intervals for the odds ratio.  */
*/

title 'Example 4: Conditional Logistic Regression for Matched Pairs';
data Data1;
  do ID=1 to 63;
    do Outcome = 1 to 0 by -1;
      input Gall Hyper @@;
      output;
    end;
  end;
  datalines;
0 0  0 0    0 0  0 0    0 1  0 1    0 0  1 0    1 0  0 1
0 1  0 0    1 0  0 0    1 1  0 1    0 0  0 0    0 0  0 0
1 0  0 0    0 0  0 1    1 0  0 1    1 0  1 0    1 0  0 1
0 1  0 0    0 0  1 1    0 0  1 1    0 0  0 1    0 1  0 0
0 0  1 1    0 1  0 1    0 1  0 0    0 0  0 0    0 0  0 0
0 0  0 1    1 0  0 1    0 0  0 1    1 0  0 0    0 1  0 0
0 1  0 0    0 1  0 0    0 1  0 0    0 0  0 0    1 1  1 1
0 0  0 1    0 1  0 0    0 1  0 1    0 1  0 1    0 1  0 0
0 0  0 0    0 1  1 0    0 0  0 1    0 0  0 0    1 0  0 0
0 0  0 0    1 1  0 0    0 1  0 0    0 0  0 0    0 1  0 1
0 0  0 0    0 1  0 1    0 1  0 0    0 1  0 0    1 0  0 0
0 0  0 0    1 1  1 0    0 0  0 0    0 0  0 0    1 1  0 0
1 0  1 0    0 1  0 0    1 0  0 0
;
data Data2;
   set Data1;
   drop id1 gall1 hyper1;
   retain id1 gall1 hyper1 0;
   if (ID = id1) then do;
      Gall=gall1-Gall; Hyper=hyper1-Hyper;
      output;
   end;
   else do;
      id1=ID; gall1=Gall; hyper1=Hyper;
   end;
run;
proc hplogistic data=Data2;
   model outcome=Gall / noint cl;
run;