Hello,
I'm trying to run logistic regressions on panel data where the dependent and most of the independent variables are factor variables.
This was going well, or so I thought, all of yesterday. I locked my computer for the night, then came back in this morning to find that Stata had closed (it must've crashed overnight). I reopen it, and try to continue with the regressions but I started getting the 'not concave' message next to iterations and they take forever, and give me different coefficients for the same variables than they did yesterday. I've looked at the data quite extensively to confirm that nothing has changed. I can't find any changes in the data from yesterday (since Feb 26th I've been using the same data file). So that I don't understand but I'm not sure if it's relevant in the end.
So for example if I try to regress these two variables:
tabulate Sigdum
1 stands |
for |
signatory |
ever, 0 for |
non |
signatory |
ever | Freq. Percent Cum.
------------+-----------------------------------
0 | 4,565 66.21 66.21
1 | 2,330 33.79 100.00
------------+-----------------------------------
Total | 6,895 100.00
and
tabulate invtype1
invsubtype= |
=Bank | Freq. Percent Cum.
------------+-----------------------------------
0 | 5,975 86.66 86.66
1 | 920 13.34 100.00
------------+-----------------------------------
Total | 6,895 100.00
collin Sigdum invtype1
(obs=6895)
Collinearity Diagnostics
SQRT R-
Variable VIF VIF Tolerance Squared
----------------------------------------------------
Sigdum 1.06 1.03 0.9403 0.0597
invtype1 1.06 1.03 0.9403 0.0597
----------------------------------------------------
Mean VIF 1.06
Cond
Eigenval Index
---------------------------------
1 1.6991 1.0000
2 0.9754 1.3198
3 0.3255 2.2846
---------------------------------
Condition Number 2.2846
Eigenvalues & Cond Index computed from scaled raw sscp (w/ intercept)
Det(correlation matrix) 0.9403
I get this:
xtlogit Sigdum invtype1
Fitting comparison model:
Iteration 0: log likelihood = -4410.3884
Iteration 1: log likelihood = -4155.0693
Iteration 2: log likelihood = -4141.9113
Iteration 3: log likelihood = -4141.7319
Iteration 4: log likelihood = -4141.7318
Fitting full model:
tau = 0.0 log likelihood = -4141.7318
tau = 0.1 log likelihood = -3859.1785
tau = 0.2 log likelihood = -3589.5994
tau = 0.3 log likelihood = -3329.4891
tau = 0.4 log likelihood = -3075.1791
tau = 0.5 log likelihood = -2822.4534
tau = 0.6 log likelihood = -2565.8646
tau = 0.7 log likelihood = -2297.524
tau = 0.8 log likelihood = -2004.2833
Iteration 0: log likelihood = -2297.6501
Iteration 1: log likelihood = -922.75302 (not concave)
Iteration 2: log likelihood = -903.64802 (not concave)
Iteration 3: log likelihood = -880.97104 (not concave)
Iteration 4: log likelihood = -880.97104 (not concave)
Iteration 5: log likelihood = -762.70679 (not concave)
Iteration 6: log likelihood = -685.72911
Iteration 7: log likelihood = -662.53369
Iteration 8: log likelihood = -662.13046
Iteration 9: log likelihood = -662.12966
Iteration 10: log likelihood = -662.12966
Random-effects logistic regression Number of obs = 6895
Group variable: AccountName_~m Number of groups = 1379
Random effects u_i ~ Gaussian Obs per group: min = 5
avg = 5.0
max = 5
Wald chi2(1) = 147.23
Log likelihood = -662.12966 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
Sigdum | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
invtype1 | -7.662794 .6315268 -12.13 0.000 -8.900564 -6.425024
_cons | -1.080827 .2690903 -4.02 0.000 -1.608234 -.5534194
-------------+----------------------------------------------------------------
/lnsig2u | 3.566572 .0485766 3.471363 3.66178
-------------+----------------------------------------------------------------
sigma_u | 5.949373 .1445001 5.672793 6.239437
rho | .9149573 .0037798 .9072505 .9220788
------------------------------------------------------------------------------
Likelihood-ratio test of rho=0: chibar2(01) = 6959.20 Prob >= chibar2 = 0.000
And it takes forever as mentioned. I've been looking for solutions all day but I'm not very advanced in stata or statistics in general but what I read seemed to link this issue to collinearity. Hence I did the test above to check for collinearity but the VIF measure seems okay since it's below 2.5 which I understand is where it gets problematic.
This is the output for the same regression from yesterday which I had saved in Excel. As you can see the coefficient is much lower here:
It may be clearer from this screenshot:
I have the same problem with virtually any other variable in the dataset, including continuous variables, and also when I try to run the regression with more than one explanatory variable, keeping Sigdum as the factor dependent variable. I would be very grateful if anyone had an idea what the problem might be. Please ask for extra information if needed - I'm not sure what is most useful/neccessary to include in this question.
Many thanks in advance.
I'm trying to run logistic regressions on panel data where the dependent and most of the independent variables are factor variables.
This was going well, or so I thought, all of yesterday. I locked my computer for the night, then came back in this morning to find that Stata had closed (it must've crashed overnight). I reopen it, and try to continue with the regressions but I started getting the 'not concave' message next to iterations and they take forever, and give me different coefficients for the same variables than they did yesterday. I've looked at the data quite extensively to confirm that nothing has changed. I can't find any changes in the data from yesterday (since Feb 26th I've been using the same data file). So that I don't understand but I'm not sure if it's relevant in the end.
So for example if I try to regress these two variables:
tabulate Sigdum
1 stands |
for |
signatory |
ever, 0 for |
non |
signatory |
ever | Freq. Percent Cum.
------------+-----------------------------------
0 | 4,565 66.21 66.21
1 | 2,330 33.79 100.00
------------+-----------------------------------
Total | 6,895 100.00
and
tabulate invtype1
invsubtype= |
=Bank | Freq. Percent Cum.
------------+-----------------------------------
0 | 5,975 86.66 86.66
1 | 920 13.34 100.00
------------+-----------------------------------
Total | 6,895 100.00
collin Sigdum invtype1
(obs=6895)
Collinearity Diagnostics
SQRT R-
Variable VIF VIF Tolerance Squared
----------------------------------------------------
Sigdum 1.06 1.03 0.9403 0.0597
invtype1 1.06 1.03 0.9403 0.0597
----------------------------------------------------
Mean VIF 1.06
Cond
Eigenval Index
---------------------------------
1 1.6991 1.0000
2 0.9754 1.3198
3 0.3255 2.2846
---------------------------------
Condition Number 2.2846
Eigenvalues & Cond Index computed from scaled raw sscp (w/ intercept)
Det(correlation matrix) 0.9403
I get this:
xtlogit Sigdum invtype1
Fitting comparison model:
Iteration 0: log likelihood = -4410.3884
Iteration 1: log likelihood = -4155.0693
Iteration 2: log likelihood = -4141.9113
Iteration 3: log likelihood = -4141.7319
Iteration 4: log likelihood = -4141.7318
Fitting full model:
tau = 0.0 log likelihood = -4141.7318
tau = 0.1 log likelihood = -3859.1785
tau = 0.2 log likelihood = -3589.5994
tau = 0.3 log likelihood = -3329.4891
tau = 0.4 log likelihood = -3075.1791
tau = 0.5 log likelihood = -2822.4534
tau = 0.6 log likelihood = -2565.8646
tau = 0.7 log likelihood = -2297.524
tau = 0.8 log likelihood = -2004.2833
Iteration 0: log likelihood = -2297.6501
Iteration 1: log likelihood = -922.75302 (not concave)
Iteration 2: log likelihood = -903.64802 (not concave)
Iteration 3: log likelihood = -880.97104 (not concave)
Iteration 4: log likelihood = -880.97104 (not concave)
Iteration 5: log likelihood = -762.70679 (not concave)
Iteration 6: log likelihood = -685.72911
Iteration 7: log likelihood = -662.53369
Iteration 8: log likelihood = -662.13046
Iteration 9: log likelihood = -662.12966
Iteration 10: log likelihood = -662.12966
Random-effects logistic regression Number of obs = 6895
Group variable: AccountName_~m Number of groups = 1379
Random effects u_i ~ Gaussian Obs per group: min = 5
avg = 5.0
max = 5
Wald chi2(1) = 147.23
Log likelihood = -662.12966 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
Sigdum | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
invtype1 | -7.662794 .6315268 -12.13 0.000 -8.900564 -6.425024
_cons | -1.080827 .2690903 -4.02 0.000 -1.608234 -.5534194
-------------+----------------------------------------------------------------
/lnsig2u | 3.566572 .0485766 3.471363 3.66178
-------------+----------------------------------------------------------------
sigma_u | 5.949373 .1445001 5.672793 6.239437
rho | .9149573 .0037798 .9072505 .9220788
------------------------------------------------------------------------------
Likelihood-ratio test of rho=0: chibar2(01) = 6959.20 Prob >= chibar2 = 0.000
And it takes forever as mentioned. I've been looking for solutions all day but I'm not very advanced in stata or statistics in general but what I read seemed to link this issue to collinearity. Hence I did the test above to check for collinearity but the VIF measure seems okay since it's below 2.5 which I understand is where it gets problematic.
This is the output for the same regression from yesterday which I had saved in Excel. As you can see the coefficient is much lower here:
| xtlogit Sigdum invtype1 | |||||||||||
| Wald | chi2(1) | = | 254.8 | ||||||||
| Log | likelihood | = | -4141.73 | Prob | > | chi2 | = | 0 | |||
| ------------------------------------------------------------------------------ | |||||||||||
| Sigdum | | | Coef. | Std.e | z | P>|z| | [95% | Conf. | Interval] | |||
| -------------+---------------------------------------------------------------- | |||||||||||
| invtype1 | | | -2.61532 | 0.163843 | -15.96 | 0 | -2.93645 | -2.2942 | ||||
| _cons | | | -0.47572 | 0.026609 | -17.88 | 0 | -0.52787 | -0.42357 | ||||
| -------------+---------------------------------------------------------------- | |||||||||||
| /lnsig2u | | | -37.5239 | 5223377 | -1.02E+07 | 1.02E+07 | ||||||
| -------------+---------------------------------------------------------------- | |||||||||||
| sigma_u | | | 7.11E-09 | 0.018566 | 0 | . | ||||||
| rho | | | 1.54E-17 | 8.02E-11 | 0 | . | ||||||
| ------------------------------------------------------------------------------ | |||||||||||
| Likelihood-ratio | test | of | rho=0: | chibar2(01) | = | 0 | Prob | >= | chibar2 | = | 1 |
Many thanks in advance.

Comment