Help using Base SAS procedures

PROC LOGISTIC vs PROC GENMOD (different results)

Reply
Contributor
Posts: 52

PROC LOGISTIC vs PROC GENMOD (different results)

Hi,

I just tried to run a logistic model. But the two procedures produced different parameter estimates for intercept and coefficients. The TYPE3 result is also slighly different.

My understanding is that the result from PROC GENMOD is correct. But don't understand the output from PROC LOGISTIC. They should not really product different results.

data work.a;
  input y x1 $ x2 $;
  datalines;
  0 a a
  1 a a
  1 a b
  0 a b
  1 b a
  0 b a
  1 b b
  0 b b
  1 c a
  1 c a
  0 c b
  1 c b
  1 a b
  0 a a
  1 b a
  1 a a
  0 c b
  0 b b
  1 b a
  0 c a
;


proc logistic data=work.a outest=work.coeff descending;
  class x1 x2;
  model y=x1 x2;
run;

proc genmod data=work.a descending;
  class x1 x2;
  model y=x1 x2 / D=b type3;
  ods output ParameterEstimates=work.coeff2(drop=lowerwaldcl upperwaldcl);
run;

proc print data=work.coeff;
run;

proc print data=work.coeff2;
run;


/*Results:*/

/*proc logistic*/

                                 Standard          Wald
Parameter      DF    Estimate       Error    Chi-Square    Pr > ChiSq

Intercept       1      0.1612      0.4606        0.1226        0.7263
x1        a     1      0.0806      0.6426        0.0157        0.9002
x1        b     1      0.0806      0.6426        0.0157        0.9002
x2        a     1      0.3852      0.4602        0.7006        0.4026

/*proc genmod*/
                                                                         Prob
Obs    Parameter    Level1    DF    Estimate      StdErr      ChiSq     ChiSq

1     Intercept               1     -0.3852      0.9505       0.16    0.6853
2     x1             a        1      0.2419      1.1394       0.05    0.8319
3     x1             b        1      0.2419      1.1394       0.05    0.8319
4     x1             c        0      0.0000      0.0000        .       .
5     x2             a        1      0.7704      0.9204       0.70    0.4026
6     x2             b        0      0.0000      0.0000        .       .

Frequent Contributor
Posts: 104

PROC LOGISTIC vs PROC GENMOD (different results)

The difference is in the effects parametrization.  If you use

proc logistic data=work.a outest=work.coeff descending;

     class x1 x2 / param=glm;

     model y=x1 x2;

run;

This output is identical to the genmod result.

The default parametrization is called "EFFECT" which has a different way of setting up the dummy variable values.

Ask a Question
Discussion stats
  • 1 reply
  • 130 views
  • 1 like
  • 2 in conversation