Logistic Regression: A Self-learning Text, Third Edition (Statistics in the Health Sciences)

(vip2019) #1

PROC GLIMMIX DATA¼REF.INFANT;


CLASS IDNO;


MODEL OUTCOME¼BIRTHWGT GENDER DIARRHEA / DIST¼BIN LINK¼LOGIT


SOLUTION;


RANDOM INTERCEPT DIARRHEA / SUBJECT¼IDNO TYPE¼UN GCORR;


RANDOM RESIDUAL / SUBJECT¼IDNO TYPE¼AR(1) GROUP¼GENDER VCORR;


RUN;


Here, there are two RANDOM statements, one for specifying the G matrix and the
other for the residuals (the R matrix). The GROUP¼GENDER option in the second
RANDOM statement requests a different set of AR(1) parameters to be estimated for
boy and girl infants. Typically, when a user specifies a covariance or correlation
structure, the values of the covariance parameters are assumed to be the same for
each cluster (subject) in the dataset. The GROUP¼option allows a different set of
covariance parameters to be estimated for specified subgroups.


PROC GLIMMIX also accommodates models with nested effects. As a hypothetical
example, suppose 30 daycare centers were randomly sampled and within each
daycare center 10 infants were sampled yielding 300 infants in all (3010). Also,
each infant has monthly measurements over a 9-month period. In this setting, we
can consider three types of independent variables: (1) a variable like DIARRHEA
whose status may vary within an infant from month-to-month, (2) a variable like
GENDER which is fixed at the infant level (does not vary month-to-month), and
(3) a variable that is fixed at the daycare level such as the size of the daycare
center. Here we have a cluster of daycare centers and nested within each daycare
center is a cluster of infants. In the infant dataset, the variable identifying each
infant is called IDNO. Suppose the variable identifying the daycare center was
called DAYCARE (this variable does not actually exist in the infant dataset).
Consider a model with a random intercept for each infant as well as a random
intercept for each daycare center. We continue to use BIRTHWEIGHT, GEN-
DER, and DIARRHEA as fixed effects. The code to run such a model in PROC
GLIMIX is:


PROC GLIMMIX DATA¼REF.INFANT;
CLASS IDNO DAYCARE;
MODEL OUTCOME¼BIRTHWGT GENDER DIARRHEA / DIST¼BIN LINK¼LOGIT
SOLUTION;
RANDOM INTERCEPT/ SUBJECT¼IDNO;
RANDOM INTERCEPT/ SUBJECT¼DAYCARE(IDNO);
RUN;

The second RANDOM statement contains the option SUBJECT¼DAYCARE(IDNO)
which indicates that infants (IDNO) are nested within daycare centers. A random
slope parameter could be added to either RANDOM statement depending on whether
the slope is modeled to randomly vary by infant or by daycare center.


The SAS section of this appendix is completed. Next, modeling with SPSS software is
illustrated.


634 Appendix: Computer Programs for Logistic Regression

Free download pdf