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 . .
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.