## Interaction effect in PROC GENMOD

Solved
Frequent Contributor
Posts: 131

# Interaction effect in PROC GENMOD

Hi Sir,

I just have an interesting question, maybe useful for many to understand. I am doing an analysis using the GENMOD procedure for the binary variable group (1, 0). The only 2 variables are sex (M, F) and married (Y, N).

The test is for the interaction term sex*married. In one program, sex*married was directly specified in the MODEL statement. In the other program, a new variable 'inter' was created to represent the cross-table of sex and married. The test showed that for both programs, the parameter estimates were exactly the same. However, for the second case, the type3 values failed to be reported for the main effects of sex and married. I have expected that for both programs, the type3 values should be the same as well.

Can a statistical expert give some explanation?

data work.data;
set base.data;
if sex='M' and married='Y' then inter=1;
else if sex='M' and married='N' then inter=2;
else if sex='F' and married='Y' then inter=3;
else inter=4;
run;

/*Program 1*/

proc genmod data=work.data;
class group sex married;
model group=sex married sex*married /dist=binomial type3;
run;

/*Result:*/

The GENMOD Procedure

LR Statistics For Type 3 Analysis

Chi-
Source           DF     Square    Pr > ChiSq

sex               1     514.94        <.0001
married           1       0.56        0.4551
sex*married       1       0.37        0.5449

/*Program 2*/

proc genmod data=work.data;
class group sex married inter;
model group=sex married inter /dist=binomial type3;
run;

/*Result:*/

LR Statistics For Type 3 Analysis

Chi-
Source           DF     Square    Pr > ChiSq

sex               0       0.00         .
married           0       0.00         .
inter             1       0.37        0.5449

Accepted Solutions
Solution
‎10-18-2011 12:52 PM
Frequent Contributor
Posts: 131

## Interaction effect in PROC GENMOD

I found a solution: just use PROC LOGISTIC, which can estimate type3 for sex and married when inter is specified (rather than sex*married).

All Replies
Solution
‎10-18-2011 12:52 PM
Frequent Contributor
Posts: 131

## Interaction effect in PROC GENMOD

I found a solution: just use PROC LOGISTIC, which can estimate type3 for sex and married when inter is specified (rather than sex*married).

🔒 This topic is solved and locked.