Dear statalist,
I want to predict the random effects for practice and patient from a null model, mixed effects logistic regression model using meqrlogit. I have 16,745 patients with data over 14, 2-month timeperiods (over 2 years), who are registered within 179 practices. I want to estimate predicted 1)practice level random effects 2)patient level random effects. I am getting results for some but not as many as i thought I would or need to be able to subsequently apply the estimated random effects into another model.
Would there be any alternative options for predicting random effects or something that I have missed?
Any help greatly appreciated.
Bryony
meqrlogit anticholinergics ||pracid: ||patid :
Refining starting values:
Iteration 0: log likelihood = -43219.872 (not concave)
Iteration 1: log likelihood = -34783.372 (not concave)
Iteration 2: log likelihood = -30222.608
Performing gradient-based optimization:
Iteration 0: log likelihood = -30222.608 (not concave)
Iteration 1: log likelihood = -29495.26
Iteration 2: log likelihood = -29236.162
Iteration 3: log likelihood = -29209.8
Iteration 4: log likelihood = -29208.463
Iteration 5: log likelihood = -29208.457
Iteration 6: log likelihood = -29208.457
Mixed-effects logistic regression Number of obs = 151,802
----------------------------------------------------------------------------
| No. of Observations per Group Integration
Group Variable | Groups Minimum Average Maximum Points
----------------+-----------------------------------------------------------
pracid | 282 9 538.3 2,357 7
patid | 22,845 1 6.6 14 7
----------------------------------------------------------------------------
Wald chi2(0) = .
Log likelihood = -29208.457 Prob > chi2 = .
------------------------------------------------------------------------------
anticholi~cs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons | -6.402485 .1315756 -48.66 0.000 -6.660368 -6.144601
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
pracid: Identity |
var(_cons) | 2.455507 .2387268 2.029488 2.970953
-----------------------------+------------------------------------------------
patid: Identity |
var(_cons) | 31.90439 .7205204 30.52299 33.3483
------------------------------------------------------------------------------
LR test vs. logistic model: chi2(2) = 75220.01 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
predict b* , reffects relevel(patid)
(151,630 missing values generated)
. predict c* , reffects relevel(pracid)
(151,630 missing values generated)
tab c1
random |
effects for |
pracid: |
_cons | Freq. Percent Cum.
------------+-----------------------------------
-4.657479 | 32 18.60 18.60
-1.281644 | 22 12.79 31.40
-.083283 | 28 16.28 47.67
-.0335804 | 9 5.23 52.91
.6104849 | 27 15.70 68.60
.8109205 | 19 11.05 79.65
1.666388 | 15 8.72 88.37
1.990422 | 20 11.63 100.00
------------+-----------------------------------
Total | 172 100.00
. tab b1
random |
effects for |
patid: |
_cons | Freq. Percent Cum.
------------+-----------------------------------
-95.71317 | 4 2.33 2.33
-31.90439 | 4 2.33 4.65
-.2211843 | 6 3.49 8.14
-.2210106 | 6 3.49 11.63
-.2208492 | 6 3.49 15.12
-.1600022 | 4 2.33 17.44
-.1254416 | 3 1.74 19.19
-.0876188 | 2 1.16 20.35
-.0484864 | 1 0.58 20.93
-.0484824 | 1 0.58 21.51
-.0484799 | 1 0.58 22.09
-.0484788 | 1 0.58 22.67
-.0484786 | 1 0.58 23.26
-.048477 | 1 0.58 23.84
-.0484761 | 1 0.58 24.42
-.0484758 | 1 0.58 25.00
-.0484755 | 1 0.58 25.58
-.0459889 | 1 0.58 26.16
6.50e-12 | 2 1.16 27.33
6.51e-12 | 1 0.58 27.91
6.73e-12 | 1 0.58 28.49
6.74e-12 | 1 0.58 29.07
7.19e-11 | 1 0.58 29.65
7.24e-11 | 1 0.58 30.23
7.34e-11 | 1 0.58 30.81
7.36e-11 | 1 0.58 31.40
1.008931 | 1 0.58 31.98
1.009315 | 1 0.58 32.56
1.469205 | 2 1.16 33.72
1.469297 | 2 1.16 34.88
1.469654 | 2 1.16 36.05
1.469823 | 2 1.16 37.21
1.469865 | 2 1.16 38.37
1.470861 | 2 1.16 39.53
1.471454 | 2 1.16 40.70
1.471791 | 2 1.16 41.86
1.471795 | 2 1.16 43.02
1.520135 | 1 0.58 43.60
1.520228 | 1 0.58 44.19
1.520525 | 1 0.58 44.77
1.520648 | 1 0.58 45.35
1.520754 | 1 0.58 45.93
1.520766 | 1 0.58 46.51
1.52077 | 1 0.58 47.09
1.521079 | 1 0.58 47.67
1.521096 | 1 0.58 48.26
1.521131 | 1 0.58 48.84
1.521356 | 1 0.58 49.42
1.521464 | 1 0.58 50.00
1.521658 | 1 0.58 50.58
1.522201 | 1 0.58 51.16
1.522376 | 1 0.58 51.74
1.52243 | 1 0.58 52.33
1.522927 | 1 0.58 52.91
1.663045 | 1 0.58 53.49
1.664052 | 1 0.58 54.07
1.664883 | 1 0.58 54.65
1.665078 | 1 0.58 55.23
1.665428 | 1 0.58 55.81
1.665572 | 1 0.58 56.40
1.66567 | 1 0.58 56.98
1.665809 | 1 0.58 57.56
1.666155 | 1 0.58 58.14
1.666157 | 1 0.58 58.72
1.666335 | 1 0.58 59.30
1.66656 | 1 0.58 59.88
1.666619 | 1 0.58 60.47
2.24909 | 1 0.58 61.05
2.252264 | 1 0.58 61.63
2.25259 | 1 0.58 62.21
2.375746 | 1 0.58 62.79
2.600591 | 2 1.16 63.95
2.716698 | 1 0.58 64.53
2.716992 | 1 0.58 65.12
2.71707 | 1 0.58 65.70
2.717136 | 1 0.58 66.28
2.718162 | 1 0.58 66.86
2.767637 | 6 3.49 70.35
2.792311 | 8 4.65 75.00
2.91461 | 2 1.16 76.16
2.91467 | 2 1.16 77.33
2.914684 | 2 1.16 78.49
2.915477 | 2 1.16 79.65
2.915803 | 2 1.16 80.81
2.917854 | 2 1.16 81.98
2.918871 | 2 1.16 83.14
2.918957 | 2 1.16 84.30
2.919433 | 2 1.16 85.47
3.284325 | 2 1.16 86.63
3.881068 | 3 1.74 88.37
4.249933 | 4 2.33 90.70
4.253342 | 4 2.33 93.02
4.253466 | 4 2.33 95.35
4.256565 | 4 2.33 97.67
4.265924 | 4 2.33 100.00
------------+-----------------------------------
Total | 172 100.00
I want to predict the random effects for practice and patient from a null model, mixed effects logistic regression model using meqrlogit. I have 16,745 patients with data over 14, 2-month timeperiods (over 2 years), who are registered within 179 practices. I want to estimate predicted 1)practice level random effects 2)patient level random effects. I am getting results for some but not as many as i thought I would or need to be able to subsequently apply the estimated random effects into another model.
Would there be any alternative options for predicting random effects or something that I have missed?
Any help greatly appreciated.
Bryony
meqrlogit anticholinergics ||pracid: ||patid :
Refining starting values:
Iteration 0: log likelihood = -43219.872 (not concave)
Iteration 1: log likelihood = -34783.372 (not concave)
Iteration 2: log likelihood = -30222.608
Performing gradient-based optimization:
Iteration 0: log likelihood = -30222.608 (not concave)
Iteration 1: log likelihood = -29495.26
Iteration 2: log likelihood = -29236.162
Iteration 3: log likelihood = -29209.8
Iteration 4: log likelihood = -29208.463
Iteration 5: log likelihood = -29208.457
Iteration 6: log likelihood = -29208.457
Mixed-effects logistic regression Number of obs = 151,802
----------------------------------------------------------------------------
| No. of Observations per Group Integration
Group Variable | Groups Minimum Average Maximum Points
----------------+-----------------------------------------------------------
pracid | 282 9 538.3 2,357 7
patid | 22,845 1 6.6 14 7
----------------------------------------------------------------------------
Wald chi2(0) = .
Log likelihood = -29208.457 Prob > chi2 = .
------------------------------------------------------------------------------
anticholi~cs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons | -6.402485 .1315756 -48.66 0.000 -6.660368 -6.144601
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
pracid: Identity |
var(_cons) | 2.455507 .2387268 2.029488 2.970953
-----------------------------+------------------------------------------------
patid: Identity |
var(_cons) | 31.90439 .7205204 30.52299 33.3483
------------------------------------------------------------------------------
LR test vs. logistic model: chi2(2) = 75220.01 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
predict b* , reffects relevel(patid)
(151,630 missing values generated)
. predict c* , reffects relevel(pracid)
(151,630 missing values generated)
tab c1
random |
effects for |
pracid: |
_cons | Freq. Percent Cum.
------------+-----------------------------------
-4.657479 | 32 18.60 18.60
-1.281644 | 22 12.79 31.40
-.083283 | 28 16.28 47.67
-.0335804 | 9 5.23 52.91
.6104849 | 27 15.70 68.60
.8109205 | 19 11.05 79.65
1.666388 | 15 8.72 88.37
1.990422 | 20 11.63 100.00
------------+-----------------------------------
Total | 172 100.00
. tab b1
random |
effects for |
patid: |
_cons | Freq. Percent Cum.
------------+-----------------------------------
-95.71317 | 4 2.33 2.33
-31.90439 | 4 2.33 4.65
-.2211843 | 6 3.49 8.14
-.2210106 | 6 3.49 11.63
-.2208492 | 6 3.49 15.12
-.1600022 | 4 2.33 17.44
-.1254416 | 3 1.74 19.19
-.0876188 | 2 1.16 20.35
-.0484864 | 1 0.58 20.93
-.0484824 | 1 0.58 21.51
-.0484799 | 1 0.58 22.09
-.0484788 | 1 0.58 22.67
-.0484786 | 1 0.58 23.26
-.048477 | 1 0.58 23.84
-.0484761 | 1 0.58 24.42
-.0484758 | 1 0.58 25.00
-.0484755 | 1 0.58 25.58
-.0459889 | 1 0.58 26.16
6.50e-12 | 2 1.16 27.33
6.51e-12 | 1 0.58 27.91
6.73e-12 | 1 0.58 28.49
6.74e-12 | 1 0.58 29.07
7.19e-11 | 1 0.58 29.65
7.24e-11 | 1 0.58 30.23
7.34e-11 | 1 0.58 30.81
7.36e-11 | 1 0.58 31.40
1.008931 | 1 0.58 31.98
1.009315 | 1 0.58 32.56
1.469205 | 2 1.16 33.72
1.469297 | 2 1.16 34.88
1.469654 | 2 1.16 36.05
1.469823 | 2 1.16 37.21
1.469865 | 2 1.16 38.37
1.470861 | 2 1.16 39.53
1.471454 | 2 1.16 40.70
1.471791 | 2 1.16 41.86
1.471795 | 2 1.16 43.02
1.520135 | 1 0.58 43.60
1.520228 | 1 0.58 44.19
1.520525 | 1 0.58 44.77
1.520648 | 1 0.58 45.35
1.520754 | 1 0.58 45.93
1.520766 | 1 0.58 46.51
1.52077 | 1 0.58 47.09
1.521079 | 1 0.58 47.67
1.521096 | 1 0.58 48.26
1.521131 | 1 0.58 48.84
1.521356 | 1 0.58 49.42
1.521464 | 1 0.58 50.00
1.521658 | 1 0.58 50.58
1.522201 | 1 0.58 51.16
1.522376 | 1 0.58 51.74
1.52243 | 1 0.58 52.33
1.522927 | 1 0.58 52.91
1.663045 | 1 0.58 53.49
1.664052 | 1 0.58 54.07
1.664883 | 1 0.58 54.65
1.665078 | 1 0.58 55.23
1.665428 | 1 0.58 55.81
1.665572 | 1 0.58 56.40
1.66567 | 1 0.58 56.98
1.665809 | 1 0.58 57.56
1.666155 | 1 0.58 58.14
1.666157 | 1 0.58 58.72
1.666335 | 1 0.58 59.30
1.66656 | 1 0.58 59.88
1.666619 | 1 0.58 60.47
2.24909 | 1 0.58 61.05
2.252264 | 1 0.58 61.63
2.25259 | 1 0.58 62.21
2.375746 | 1 0.58 62.79
2.600591 | 2 1.16 63.95
2.716698 | 1 0.58 64.53
2.716992 | 1 0.58 65.12
2.71707 | 1 0.58 65.70
2.717136 | 1 0.58 66.28
2.718162 | 1 0.58 66.86
2.767637 | 6 3.49 70.35
2.792311 | 8 4.65 75.00
2.91461 | 2 1.16 76.16
2.91467 | 2 1.16 77.33
2.914684 | 2 1.16 78.49
2.915477 | 2 1.16 79.65
2.915803 | 2 1.16 80.81
2.917854 | 2 1.16 81.98
2.918871 | 2 1.16 83.14
2.918957 | 2 1.16 84.30
2.919433 | 2 1.16 85.47
3.284325 | 2 1.16 86.63
3.881068 | 3 1.74 88.37
4.249933 | 4 2.33 90.70
4.253342 | 4 2.33 93.02
4.253466 | 4 2.33 95.35
4.256565 | 4 2.33 97.67
4.265924 | 4 2.33 100.00
------------+-----------------------------------
Total | 172 100.00
Comment