Hi I am doing analysis 8-year panel data which has two level; individual(id) and household(hhid).
1. I am wondering how to decide lrtest in xtmixed about random intercept model and random slope model.
Here is my code and result.
================================================== ==
. . xtmixed d econ_d || id: ||hhid: , iter(1)
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -129385.05
Iteration 1: log likelihood = -129385.05 (not concave)
convergence not achieved
Computing standard errors:
Mixed-effects ML regression Number of obs = 37424
-----------------------------------------------------------
| No. of Observations per Group
Group Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
id | 4678 8 8.0 8
hhid | 4678 8 8.0 8
-----------------------------------------------------------
Wald chi2(1) = 249.44
Log likelihood = -129385.05 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
d | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
econ_d | 2.154423 .1364098 15.79 0.000 1.887065 2.421782
_cons | 7.511848 .0872245 86.12 0.000 7.340891 7.682805
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
sd(_cons) | 3.780967 67.04078 3.05e-15 4.68e+15
-----------------------------+------------------------------------------------
hhid: Identity |
sd(_cons) | 3.780968 67.04077 3.05e-15 4.68e+15
-----------------------------+------------------------------------------------
sd(Residual) | 6.876201 .026937 6.823608 6.9292
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(2) = 8644.87 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
Warning: convergence not achieved; estimates are based on iterated EM
. estimates store rint
. . xtmixed d econ_d || id: ||hhid: econ_d
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -129264.81
Iteration 1: log likelihood = -129253.19 (not concave)
Iteration 2: log likelihood = -129253.13 (backed up)
Iteration 3: log likelihood = -129253.09 (not concave)
Iteration 4: log likelihood = -129253.09 (backed up)
Computing standard errors:
Mixed-effects ML regression Number of obs = 37424
-----------------------------------------------------------
| No. of Observations per Group
Group Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
id | 4678 8 8.0 8
hhid | 4678 8 8.0 8
-----------------------------------------------------------
Wald chi2(1) = 140.07
Log likelihood = -129253.09 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
d | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
econ_d | 2.060142 .1740728 11.83 0.000 1.718966 2.401319
_cons | 7.472637 .0850595 87.85 0.000 7.305924 7.639351
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
sd(_cons) | 3.670353 14.29806 .0017734 7596.428
-----------------------------+------------------------------------------------
hhid: Independent |
sd(econ_d) | 4.453652 .1933661 4.090339 4.849236
sd(_cons) | 3.670753 14.2965 .0017765 7584.644
-----------------------------+------------------------------------------------
sd(Residual) | 6.785597 .0271294 6.732632 6.838979
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 8908.78 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
. estimates store rcoef
. lrtest rint rcoef
Likelihood-ratio test LR chi2(1) = 263.92
(Assumption: rint nested in rcoef) Prob > chi2 = 0.0000
Note: The reported degrees of freedom assumes the null hypothesis is not on the boundary of the parameter space. If this is not true, then the reported test is conservative.
================================================== =============================
As seen in red, p-value for the study is <.0005.
Then, in statistical perspective, which model is appropriate, between random intercept model and random slope model?
2. When I choose the appropriate model like above,
should I do with all control variables or with only the variable i am interested in?
In workshop material of Griffith Univ., which I refer, that is done like above.
1. I am wondering how to decide lrtest in xtmixed about random intercept model and random slope model.
Here is my code and result.
================================================== ==
. . xtmixed d econ_d || id: ||hhid: , iter(1)
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -129385.05
Iteration 1: log likelihood = -129385.05 (not concave)
convergence not achieved
Computing standard errors:
Mixed-effects ML regression Number of obs = 37424
-----------------------------------------------------------
| No. of Observations per Group
Group Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
id | 4678 8 8.0 8
hhid | 4678 8 8.0 8
-----------------------------------------------------------
Wald chi2(1) = 249.44
Log likelihood = -129385.05 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
d | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
econ_d | 2.154423 .1364098 15.79 0.000 1.887065 2.421782
_cons | 7.511848 .0872245 86.12 0.000 7.340891 7.682805
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
sd(_cons) | 3.780967 67.04078 3.05e-15 4.68e+15
-----------------------------+------------------------------------------------
hhid: Identity |
sd(_cons) | 3.780968 67.04077 3.05e-15 4.68e+15
-----------------------------+------------------------------------------------
sd(Residual) | 6.876201 .026937 6.823608 6.9292
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(2) = 8644.87 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
Warning: convergence not achieved; estimates are based on iterated EM
. estimates store rint
. . xtmixed d econ_d || id: ||hhid: econ_d
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -129264.81
Iteration 1: log likelihood = -129253.19 (not concave)
Iteration 2: log likelihood = -129253.13 (backed up)
Iteration 3: log likelihood = -129253.09 (not concave)
Iteration 4: log likelihood = -129253.09 (backed up)
Computing standard errors:
Mixed-effects ML regression Number of obs = 37424
-----------------------------------------------------------
| No. of Observations per Group
Group Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
id | 4678 8 8.0 8
hhid | 4678 8 8.0 8
-----------------------------------------------------------
Wald chi2(1) = 140.07
Log likelihood = -129253.09 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
d | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
econ_d | 2.060142 .1740728 11.83 0.000 1.718966 2.401319
_cons | 7.472637 .0850595 87.85 0.000 7.305924 7.639351
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
sd(_cons) | 3.670353 14.29806 .0017734 7596.428
-----------------------------+------------------------------------------------
hhid: Independent |
sd(econ_d) | 4.453652 .1933661 4.090339 4.849236
sd(_cons) | 3.670753 14.2965 .0017765 7584.644
-----------------------------+------------------------------------------------
sd(Residual) | 6.785597 .0271294 6.732632 6.838979
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 8908.78 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
. estimates store rcoef
. lrtest rint rcoef
Likelihood-ratio test LR chi2(1) = 263.92
(Assumption: rint nested in rcoef) Prob > chi2 = 0.0000
Note: The reported degrees of freedom assumes the null hypothesis is not on the boundary of the parameter space. If this is not true, then the reported test is conservative.
================================================== =============================
As seen in red, p-value for the study is <.0005.
Then, in statistical perspective, which model is appropriate, between random intercept model and random slope model?
2. When I choose the appropriate model like above,
should I do with all control variables or with only the variable i am interested in?
In workshop material of Griffith Univ., which I refer, that is done like above.
Comment