The code to run the model in PROC GENMOD using the dataset EVANS2 is:
PROC GENMOD DATA¼EVANS2;
MODEL CASES/TOTAL¼CAT AGEGRP ECG / LINK¼LOGIT DIST¼BINOMIAL;
RUN;
The DESCENDING option is not necessary if the response is in the EVENTS/TRIALS
form. The output is omitted.
The CONTRAST and ESTIMATE statements still work in PROC GENMOD when
usingEVENTS/TRIALSform. PROC LOGISTIC has a CONTRAST statement but
not an ESTIMATE statement. However, linear combinations of parameter estimates
can be calculated in PROC LOGISTIC using the ESTIMATE¼option within the
CONTRAST statement.
Suppose we wish to estimate the odds ratio comparing an individual with CAT¼ 1
and AGEGRP¼1 to an individual with CAT¼0 and AGEGRP¼0 controlling for
ECG. The odds ratio isexp(b 1 þb 2 ). The code to estimate this odds ratio is shown
below with the CONTRAST statement:
PROC LOGISTIC DATA¼EVANS2;
MODEL CASES/TOTAL¼CAT AGEGRP ECG;
CONTRAST‘CAT¼1 AGEGRP¼1 VS CAT¼0 AGEGRP¼ 0 ’CAT 1 AGEGRP 1/
ESTIMATE¼EXP;
RUN;
The quoted text following the word CONTRAST is a “label” that is printed in the
output. The user is free to define his/her own label. The ESTIMATE¼EXP option
estimates exp(b 1 þb 2 ). If instead we used the option ESTIMATE¼PARM we
would estimateb 1 þb 2 without the exponentiation. We could also use the option
ESTIMATE¼BOTH to estimate the linear combination of parameters both expo-
nentiated and not exponentiated.
A common point of confusion with the CONTRAST statement in SAS occurs with the
use of commas. Consider the following code in which PROC LOGISTIC is run with
two CONTRAST statements.
PROC LOGISTIC DATA¼EVANS2;
MODEL CASES/TOTAL¼CAT AGEGRP ECG;
CONTRAST‘1 DEGREE OF FREEDOM TEST’CAT 1 AGEGRP 1;
CONTRAST‘2 DEGREE OF FREEDOM TEST’CAT 1, AGEGRP 1;
RUN;
The first CONTRAST statement (CAT 1 AGEGRP 1) tests the hypothesisb 1 þb 2 ¼
0 while the second CONTRAST statement which contains a comma (CAT 1,
AGEGRP 1) tests the hypothesisb 1 ¼0 andb 2 ¼0 simultaneously. These are not
the same tests. Ifb 1 þb 2 ¼0, it does not necessarily mean that bothb 1 ¼0 andb 2 ¼0.
The output follows: