BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bncoxuk
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
bncoxuk
Obsidian | Level 7

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

View solution in original post

1 REPLY 1
bncoxuk
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 4972 views
  • 0 likes
  • 1 in conversation