# Re: st: -regress- vs -logit- problem

 From David Jacobs To statalist@hsphsun2.harvard.edu Subject Re: st: -regress- vs -logit- problem Date Fri, 18 Apr 2003 13:19:31 -0400

Probably your model is under identified because you have a dummy explanatory variable, but no cases appear in one of the joint categories. In other words, there must be cases in all four of the 0 or 1 possibilities of both variables. For example, if there are no (or only a few) cases that have a zero score on the dependent variable and a 1 score on a dummy explanatory variable, Stata's logit routine probably won't estimate the coefficient.

This is an extremely important feature. Other packages including older (and maybe current) versions of SPSS would ignore this problem and happily produce erroneous results. Before I had any experience with logit, I tried to help a colleague who was getting t-values greater than 40! The reason, of course, was that the package he was using didn't deal with this problem. See the discussion of this in the chapter on logit in the manual.

Dave Jacobs

At 02:42 PM 4/17/2003 -0700, you wrote:

Hello stata-listers:

I am puzzled by some regression results I obtained running -logit-,
and -regress- on the same data set with Stata7-special edition. I wonder if
someone out there has an explanation.

I have an unbalanced panel data set with 3033 observations on 605 elderly
households over 9 years (from 1990 to 1998), indexed by the variable UNITID.
In case it matters, I am studying the probability of independent living.

The dependent variable (HHindependent) is a binary indicator taking values 0
and 1. I have about 81% 1s and 18% 0s.

As preliminary analysis I just wanted to run some regression on the pooled
data set without taking full advantage of the panel nature of the data.

So I run
1) ordinary least square(linear probability model) regression using
-regress-

2) logit regression, using -logit-

on the same data, with the same list of explanatory variables: demographic
characteristics, income quartiles, year dummies, leaving out 1 year (91), s
tate dummies (I am using East German data-I am leaving out one state).

The puzzle I have comes from the fact that while the -regress- regressions
seem to run fine, while the -logit- regressions seem to have
"identification" problems (some coefficients are not estimated).

Does anybody have an idea of what may be going on?

I am reporting below the regression output for :
I - regress
II - regress with cluster (UNITID)
III- logit
IV - logit with cluster (UNITID)

______________________REGRESS

. regress HHindependent `regvarsi3e' `yrdummies91all' `Estatesreg';

Source | SS df MS Number of obs = 3033
-------------+------------------------------ F( 35, 2997) = 13.39
Model | 64.2635048 35 1.83610014 Prob > F = 0.0000
Residual | 410.965641 2997 .137125673 R-squared = 0.1352
Total | 475.229146 3032 .156737845 Root MSE = .3703

------------------------------------------------------------------------------
HHindepend~t | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age10 | 1.72529 .2094201 8.24 0.000 1.314668 2.135911
age10sq | -12.10316 1.368259 -8.85 0.000 -14.78598 -9.420341
unmarrf | -.1571164 .023347 -6.73 0.000 -.2028941 -.1113386
unmarrm | .1998399 .0614865 3.25 0.001 .07928 .3203999
REschool | .006765 .0037162 1.82 0.069 -.0005216 .0140516
working | .0592516 .0267578 2.21 0.027 .0067862 .111717
inc2ndqe | -.0080573 .0199643 -0.40 0.687 -.0472024 .0310879
inc3rdqe | .0089798 .0228005 0.39 0.694 -.0357265 .0536861
inc4thqe | .0323398 .0277629 1.16 0.244 -.0220964 .0867761
ihaskids | -.274894 .0556804 -4.94 0.000 -.3840698 -.1657183
inkids | -.0052976 .0067411 -0.79 0.432 -.0185152 .0079201
iageystkid | .0717329 .011233 6.39 0.000 .0497077 .0937582
inhosp | -.0085191 .0254949 -0.33 0.738 -.0585084 .0414701
hosday | .0004757 .0006303 0.75 0.450 -.0007602 .0017115
doc | -.0000974 .0011585 -0.08 0.933 -.002369 .0021742
HHsret | .0228024 .0067669 3.37 0.001 .0095342 .0360705
sincewid | .0189887 .0075886 2.50 0.012 .0041093 .0338682
Mtotinc | -.0207275 .0269881 -0.77 0.443 -.0736446 .0321896
Minhosp | .1661974 .1676117 0.99 0.321 -.1624482 .4948429
Mhosday | -.3761677 .3756514 -1.00 0.317 -1.112728 .3603928
Mdoc | -.6482065 .3733892 -1.74 0.083 -1.380332 .0839185
Mswid | .1085138 .0241345 4.50 0.000 .061192 .1558355
yr90 | 1.057486 .5310866 1.99 0.047 .0161551 2.098817
yr92 | .1504509 .1692793 0.89 0.374 -.1814646 .4823664
yr93 | 1.004045 .5334925 1.88 0.060 -.0420033 2.050094
yr94 | .1325063 .1716881 0.77 0.440 -.2041322 .4691448
yr95 | .1200957 .1725592 0.70 0.487 -.2182508 .4584421
yr96 | .1203629 .1735264 0.69 0.488 -.21988 .4606059
yr97 | .1056407 .1746709 0.60 0.545 -.2368463 .4481278
yr98 | .0743477 .1750938 0.42 0.671 -.2689686 .4176639
EMeckenbur~a | .0125316 .0359104 0.35 0.727 -.0578799 .0829431
EBrandenburg | -.0470541 .0326402 -1.44 0.150 -.1110536 .0169454
ESaxonyAnh~t | -.0184585 .0311472 -0.59 0.553 -.0795305 .0426135
EThuringia | -.058571 .0320749 -1.83 0.068 -.121462 .0043201
ESaxony | -.0343495 .0298691 -1.15 0.250 -.0929155 .0242165
_cons | -5.509123 .8089009 -6.81 0.000 -7.09518 -3.923066
------------------------------------------------------------------------------

______________________REGRESS WITH CLUSTER

. *w/ cluster;
. regress HHindependent `regvarsi3e' `yrdummies91all' `Estatesreg', cluster (UN
> ITID);

Regression with robust standard errors Number of obs = 3033
F( 34, 604) = .
Prob > F = .
R-squared = 0.1352
Number of clusters (UNITID) = 605 Root MSE = .3703

------------------------------------------------------------------------------
| Robust
HHindepend~t | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age10 | 1.72529 .3918699 4.40 0.000 .9556968 2.494883
age10sq | -12.10316 2.584262 -4.68 0.000 -17.17839 -7.027933
unmarrf | -.1571164 .047807 -3.29 0.001 -.2510046 -.0632282
unmarrm | .1998399 .1246804 1.60 0.109 -.0450198 .4446996
REschool | .006765 .0069224 0.98 0.329 -.00683 .02036
working | .0592516 .0338047 1.75 0.080 -.0071374 .1256406
inc2ndqe | -.0080573 .0338754 -0.24 0.812 -.0745851 .0584706
inc3rdqe | .0089798 .0421138 0.21 0.831 -.0737275 .0916871
inc4thqe | .0323398 .0459495 0.70 0.482 -.0579003 .12258
ihaskids | -.274894 .1175637 -2.34 0.020 -.5057773 -.0440107
inkids | -.0052976 .0157426 -0.34 0.737 -.0362145 .0256194
iageystkid | .0717329 .0237222 3.02 0.003 .0251448 .118321
inhosp | -.0085191 .024372 -0.35 0.727 -.0563832 .0393449
hosday | .0004757 .0005144 0.92 0.355 -.0005345 .0014859
doc | -.0000974 .0012903 -0.08 0.940 -.0026315 .0024366
HHsret | .0228024 .0121241 1.88 0.060 -.0010081 .0466128
sincewid | .0189887 .0138289 1.37 0.170 -.0081699 .0461474
Mtotinc | -.0207275 .0361028 -0.57 0.566 -.0916297 .0501747
Minhosp | .1661974 .074863 2.22 0.027 .019174 .3132207
Mhosday | -.3761677 .1257164 -2.99 0.003 -.623062 -.1292734
Mdoc | -.6482065 .0929942 -6.97 0.000 -.8308378 -.4655752
Mswid | .1085138 .0582869 1.86 0.063 -.0059558 .2229833
yr90 | 1.057486 .1727173 6.12 0.000 .7182869 1.396686
yr93 | 1.004045 .1964445 5.11 0.000 .618248 1.389842
yr94 | .1325063 .0865059 1.53 0.126 -.0373826 .3023952
yr95 | .1200957 .0926225 1.30 0.195 -.0618056 .301997
yr96 | .1203629 .0993759 1.21 0.226 -.0748014 .3155272
yr97 | .1056407 .1061331 1.00 0.320 -.1027939 .3140754
yr98 | .0743477 .1137448 0.65 0.514 -.1490356 .2977309
EMeckenbur~a | .0125316 .0722889 0.17 0.862 -.1294366 .1544998
EBrandenburg | -.0470541 .0672328 -0.70 0.484 -.1790926 .0849844
ESaxonyAnh~t | -.0184585 .0601576 -0.31 0.759 -.136602 .0996849
EThuringia | -.058571 .0668219 -0.88 0.381 -.1898025 .0726606
ESaxony | -.0343495 .0594099 -0.58 0.563 -.1510246 .0823256
_cons | -5.509123 1.464978 -3.76 0.000 -8.386191 -2.632054
------------------------------------------------------------------------------

______________________LOGIT

. logit HHindependent `regvarsi3e' `yrdummies91all' `Estatesreg';

Iteration 0: log likelihood = -1494.4222
Iteration 1: log likelihood = -1310.8318
Iteration 2: log likelihood = -1295.8374
Iteration 3: log likelihood = -1295.5631
Iteration 4: log likelihood = -1295.5231
Iteration 5: log likelihood = -1295.5088
Iteration 6: log likelihood = -1295.5035
Iteration 7: log likelihood = -1295.5016
Iteration 8: log likelihood = -1295.5009
Iteration 9: log likelihood = -1295.5007
Iteration 10: log likelihood = -1295.5006
Iteration 11: log likelihood = -1295.5005
Iteration 12: log likelihood = -1295.5005
Iteration 13: log likelihood = -1295.5005
Iteration 14: log likelihood = -1295.5005
Iteration 15: log likelihood = -1295.5005

Logit estimates Number of obs = 3033
LR chi2(35) = 397.84
Prob > chi2 = 0.0000
Log likelihood = -1295.5005 Pseudo R2 = 0.1331

------------------------------------------------------------------------------
HHindepend~t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age10 | 9.825098 1.474932 6.66 0.000 6.934284 12.71591
age10sq | -68.8575 9.606791 -7.17 0.000 -87.68646 -50.02853
unmarrf | -1.103388 .1788826 -6.17 0.000 -1.453991 -.7527847
unmarrm | 1.657784 .4979874 3.33 0.001 .6817468 2.633822
REschool | .0724962 .0353953 2.05 0.041 .0031227 .1418696
working | .4411615 .2267498 1.95 0.052 -.00326 .8855829
inc2ndqe | -.0919223 .1320087 -0.70 0.486 -.3506547 .1668101
inc3rdqe | .0288757 .1568815 0.18 0.854 -.2786063 .3363578
inc4thqe | .2958868 .2199417 1.35 0.179 -.1351911 .7269647
ihaskids | -2.227045 .4500639 -4.95 0.000 -3.109154 -1.344935
inkids | -.0282717 .0496574 -0.57 0.569 -.1255985 .069055
iageystkid | .5495892 .0880904 6.24 0.000 .3769352 .7222432
inhosp | -.0906316 .2093995 -0.43 0.665 -.501047 .3197839
hosday | .0052262 .0061117 0.86 0.392 -.0067524 .0172048
doc | .0018684 .0101601 0.18 0.854 -.0180451 .0217819
HHsret | .1578774 .0469897 3.36 0.001 .0657793 .2499756
sincewid | .1343867 .063823 2.11 0.035 .009296 .2594775
Mtotinc | -.1558351 .1971134 -0.79 0.429 -.5421703 .2305001
Minhosp | 15.10439 5.617058 2.69 0.007 4.095156 26.11362
Mhosday | -15.80332 3078.857 -0.01 0.996 -6050.253 6018.646
Mdoc | -17.5004 3078.857 -0.01 0.995 -6051.95 6016.949
Mswid | .6820572 .1757825 3.88 0.000 .3375299 1.026584
yr90 | 33.53294 .2442489 137.29 0.000 33.05423 34.01166
yr92 | 14.94642 5.605924 2.67 0.008 3.959011 25.93383
yr93 | 33.14143 . . . . .
yr94 | 14.82122 5.594651 2.65 0.008 3.855907 25.78653
yr95 | 14.74335 5.589532 2.64 0.008 3.788069 25.69863
yr96 | 14.76784 5.580191 2.65 0.008 3.830867 25.70481
yr97 | 14.68051 5.577395 2.63 0.008 3.749016 25.612
yr98 | 14.46161 5.56966 2.60 0.009 3.545275 25.37794
EMeckenbur~a | .0067768 .3069741 0.02 0.982 -.5948814 .6084349
EBrandenburg | -.3790279 .2695437 -1.41 0.160 -.9073238 .1492679
ESaxonyAnh~t | -.1671577 .266444 -0.63 0.530 -.6893783 .355063
EThuringia | -.5327646 .2672993 -1.99 0.046 -1.056662 -.0088677
ESaxony | -.3208551 .2549864 -1.26 0.208 -.8206193 .178909
_cons | -48.69204 . . . . .
------------------------------------------------------------------------------

______________________LOGIT WITH CLUSTER

. logit HHindependent `regvarsi3e' `yrdummies91all' `Estatesreg', cluster (UNIT
> ID);

Iteration 0: log likelihood = -1494.4222
Iteration 1: log likelihood = -1310.8318
Iteration 2: log likelihood = -1295.8374
Iteration 3: log likelihood = -1295.5631
Iteration 4: log likelihood = -1295.5231
Iteration 5: log likelihood = -1295.5088
Iteration 6: log likelihood = -1295.5035
Iteration 7: log likelihood = -1295.5016
Iteration 8: log likelihood = -1295.5009
Iteration 9: log likelihood = -1295.5007
Iteration 10: log likelihood = -1295.5006
Iteration 11: log likelihood = -1295.5005
Iteration 12: log likelihood = -1295.5005
Iteration 13: log likelihood = -1295.5005
Iteration 14: log likelihood = -1295.5005
Iteration 15: log likelihood = -1295.5005

Logit estimates Number of obs = 3033
Wald chi2(32) = .
Prob > chi2 = .
Log likelihood = -1295.5005 Pseudo R2 = 0.1331

(standard errors adjusted for clustering on UNITID)
------------------------------------------------------------------------------
| Robust
HHindepend~t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age10 | 9.825098 2.572489 3.82 0.000 4.783112 14.86708
age10sq | -68.8575 16.77575 -4.10 0.000 -101.7374 -35.97763
unmarrf | -1.103388 .3637325 -3.03 0.002 -1.816291 -.3904855
unmarrm | 1.657784 1.076365 1.54 0.124 -.451852 3.76742
REschool | .0724962 .0813161 0.89 0.373 -.0868805 .2318728
working | .4411615 .3172762 1.39 0.164 -.1806884 1.063011
inc2ndqe | -.0919223 .2001677 -0.46 0.646 -.4842437 .3003991
inc3rdqe | .0288757 .2644937 0.11 0.913 -.4895224 .5472739
inc4thqe | .2958868 .3632515 0.81 0.415 -.416073 1.007847
ihaskids | -2.227045 .9968293 -2.23 0.025 -4.180794 -.2732949
inkids | -.0282717 .113625 -0.25 0.804 -.2509726 .1944292
iageystkid | .5495892 .1870421 2.94 0.003 .1829935 .9161849
inhosp | -.0906316 .2123915 -0.43 0.670 -.5069112 .325648
hosday | .0052262 .0062152 0.84 0.400 -.0069554 .0174078
doc | .0018684 .0133519 0.14 0.889 -.0243009 .0280377
HHsret | .1578774 .0775546 2.04 0.042 .0058733 .3098816
sincewid | .1343867 .1248643 1.08 0.282 -.1103429 .3791164
Mtotinc | -.1558351 .2569348 -0.61 0.544 -.6594181 .3477479
Minhosp | 15.10439 9.753298 1.55 0.121 -4.011726 34.2205
Mhosday | -15.80332 . . . . .
Mdoc | -17.5004 .4866639 -35.96 0.000 -18.45424 -16.54656
Mswid | .6820572 .4135305 1.65 0.099 -.1284478 1.492562
yr90 | 33.53294 .2590115 129.47 0.000 33.02529 34.0406
yr92 | 14.94642 9.745674 1.53 0.125 -4.154751 34.04759
yr93 | 33.14143 . . . . .
yr94 | 14.82122 9.732182 1.52 0.128 -4.253505 33.89595
yr95 | 14.74335 9.717325 1.52 0.129 -4.302257 33.78896
yr96 | 14.76784 9.700585 1.52 0.128 -4.244956 33.78064
yr97 | 14.68051 9.707253 1.51 0.130 -4.345357 33.70638
yr98 | 14.46161 9.689107 1.49 0.136 -4.528694 33.45191
EMeckenbur~a | .0067768 .7102018 0.01 0.992 -1.385193 1.398747
EBrandenburg | -.3790279 .6026149 -0.63 0.529 -1.560131 .8020756
ESaxonyAnh~t | -.1671577 .5941251 -0.28 0.778 -1.331622 .9973062
EThuringia | -.5327646 .6107117 -0.87 0.383 -1.729738 .6642083
ESaxony | -.3208551 .5773546 -0.56 0.578 -1.452449 .8107391
_cons | -48.69204 . . . . .
------------------------------------------------------------------------------

----------------------------------------------------------------------

Enrica Croda

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
```
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```