Dear All,
I have been running a logistic regression of categorical variables and have encontered something odd:
I do save the predicted probability and group membership when running the analysis but when I try to recalculate the probability for each record I come up with a different value !
Here is a sample of the final output (variables in the equation):
Variable B S.E. Wald df Sig R Exp(B)
INSTFR(1) -.6720 .1239 29.3938 1 .0000 -.1002 .5107
MSACGR 16.4320 12 .1722 .0000
MSACGR(1) -.1662 .2786 .3559 1 .5508 .0000 .8469
MSACGR(2) -.3948 .2791 2.0019 1 .1571 -.0008 .6738
MSACGR(3) -.1968 .2731 .5196 1 .4710 .0000 .8213
MSACGR(4) .2088 .3442 .3680 1 .5441 .0000 1.2322
MSACGR(5) -1.0218 .5510 3.4396 1 .0637 -.0230 .3599
MSACGR(6) -.3289 .3466 .9004 1 .3427 .0000 .7197
MSACGR(7) .0855 .3120 .0750 1 .7842 .0000 1.0892
MSACGR(8) -.7764 .4445 3.0507 1 .0807 -.0196 .4600
MSACGR(9) -.0632 .3680 .0295 1 .8636 .0000 .9387
MSACGR(10) -.5036 .3062 2.7048 1 .1000 -.0161 .6044
MSACGR(11) -.2203 .3273 .4531 1 .5009 .0000 .8023
MSACGR(12) -7.4573 7.2422 1.0603 1 .3031 .0000 .0006
Constant 5.7724
Basically, I calculate the z-score as below (SPSS syntax)
Compute zscore = 5.7724.
(if MSACGR=1) zscore = zscore+ -.1662 .
(if MSACGR=2) zscore = zscore+ -.3948 .
etc ...with all the variables
at the end I calculate the probability using the formula below:
1-((EXP(-zscore))/(1+EXP(-zscore))).
The probability values are slightly different from those saved during the logistic regression procedure and this causes different prediction when defining the group membership.
I would be very grateful if someone could help and let me know whether I am doing anything wrong.
Regards
TD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|