Hello, I have been working on running a random slope model, on longitudinal data (in long form) using the logit model. However, I have encountered an issue that I cannot resolve, so I wanted to reach out to you for guidance.
Here is the description of the model:
Focal variable (outcome): Work Assessment (binary, n=1 for 682 cases, 0 for 8,701 cases)
Main predictor: Early Retirement Pressure (binary)
Total number of observations in the dataset: 57,976
Number of observations when running this model: 3,463 with 1,363 individuals
My question is as follows: I attempted to implement the random slope model as you taught us last time.
The random intercept code works well, but when I include the random slope for centered age, I encounter a "convergence" issue, and the maximum log-likelihood is reported as "not concave."
(Random Intercept)
melogit workassess i.female edu lg_hinc i.urban $health i.earlyret##c.c_age || pid:, cov(un)
(Random Slope Model)
melogit workassess i.female edu lg_hinc i.urban $health i.earlyret##c.c_age || pid: c_age, cov(un)
Is there any way to modify the model settings in this case? And Here is my result.
Iteration 296: log likelihood = -921.96692 (not concave)
Iteration 297: log likelihood = -921.96692 (not concave)
Iteration 298: log likelihood = -921.96692 (not concave)
Iteration 299: log likelihood = -921.96692 (not concave)
Iteration 300: log likelihood = -921.96692 (not concave)
convergence not achieved
Mixed-effects logistic regression Number of obs = 3,463
Group variable: pid Number of groups = 1,363
Obs per group:
min = 1
avg = 2.5
max = 4
Integration method: mvaghermite Integration pts. = 7
Wald chi2(8) = 80.77
Log likelihood = -921.96692 Prob > chi2 = 0.0000
----------------------------------------------------------------------------------
workassess | Coefficient Std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
c_age | -.0023769 .017445 -0.14 0.892 -.0365685 .0318147
1.female | .4622551 .1717717 2.69 0.007 .1255889 .7989214
edu | -.2801203 .138019 -2.03 0.042 -.5506326 -.0096081
lg_hinc | -.3565346 .1255152 -2.84 0.005 -.6025399 -.1105292
1.urban | .2396985 .2315582 1.04 0.301 -.2141473 .6935443
1.firselfhealth | .8681222 .1615322 5.37 0.000 .5515249 1.184719
chronic | .195936 .0959162 2.04 0.041 .0079438 .3839283
1.earlyret | .463443 .1886819 2.46 0.014 .0936333 .8332527
_cons | -.7321033 1.005356 -0.73 0.466 -2.702565 1.238358
-----------------+----------------------------------------------------------------
pid |
var(c_age)| .0051863 3.91e-07 .0051855 .005187
var(_cons)| .9579369 .0000659 .9578077 .9580661
-----------------+----------------------------------------------------------------
pid |
cov(c_age,_cons)| .070485 . . . . .
----------------------------------------------------------------------------------
convergence not achieved
r(430);
Additionally, I have come across the use of the "gsem" command for multilevel models. Since "gsem" is a structural equation modeling command, would it be appropriate to use it as an alternative to the current code? Thank you for your assistance.
Here is the description of the model:
Focal variable (outcome): Work Assessment (binary, n=1 for 682 cases, 0 for 8,701 cases)
Main predictor: Early Retirement Pressure (binary)
Total number of observations in the dataset: 57,976
Number of observations when running this model: 3,463 with 1,363 individuals
My question is as follows: I attempted to implement the random slope model as you taught us last time.
The random intercept code works well, but when I include the random slope for centered age, I encounter a "convergence" issue, and the maximum log-likelihood is reported as "not concave."
(Random Intercept)
melogit workassess i.female edu lg_hinc i.urban $health i.earlyret##c.c_age || pid:, cov(un)
(Random Slope Model)
melogit workassess i.female edu lg_hinc i.urban $health i.earlyret##c.c_age || pid: c_age, cov(un)
Is there any way to modify the model settings in this case? And Here is my result.
Iteration 296: log likelihood = -921.96692 (not concave)
Iteration 297: log likelihood = -921.96692 (not concave)
Iteration 298: log likelihood = -921.96692 (not concave)
Iteration 299: log likelihood = -921.96692 (not concave)
Iteration 300: log likelihood = -921.96692 (not concave)
convergence not achieved
Mixed-effects logistic regression Number of obs = 3,463
Group variable: pid Number of groups = 1,363
Obs per group:
min = 1
avg = 2.5
max = 4
Integration method: mvaghermite Integration pts. = 7
Wald chi2(8) = 80.77
Log likelihood = -921.96692 Prob > chi2 = 0.0000
----------------------------------------------------------------------------------
workassess | Coefficient Std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
c_age | -.0023769 .017445 -0.14 0.892 -.0365685 .0318147
1.female | .4622551 .1717717 2.69 0.007 .1255889 .7989214
edu | -.2801203 .138019 -2.03 0.042 -.5506326 -.0096081
lg_hinc | -.3565346 .1255152 -2.84 0.005 -.6025399 -.1105292
1.urban | .2396985 .2315582 1.04 0.301 -.2141473 .6935443
1.firselfhealth | .8681222 .1615322 5.37 0.000 .5515249 1.184719
chronic | .195936 .0959162 2.04 0.041 .0079438 .3839283
1.earlyret | .463443 .1886819 2.46 0.014 .0936333 .8332527
_cons | -.7321033 1.005356 -0.73 0.466 -2.702565 1.238358
-----------------+----------------------------------------------------------------
pid |
var(c_age)| .0051863 3.91e-07 .0051855 .005187
var(_cons)| .9579369 .0000659 .9578077 .9580661
-----------------+----------------------------------------------------------------
pid |
cov(c_age,_cons)| .070485 . . . . .
----------------------------------------------------------------------------------
convergence not achieved
r(430);
Additionally, I have come across the use of the "gsem" command for multilevel models. Since "gsem" is a structural equation modeling command, would it be appropriate to use it as an alternative to the current code? Thank you for your assistance.
Comment