How to use constraints with xtmlogit?
I try to put constraints on the variance of the random effects in the xtmlogit command. I either get error r(111) or r(133). How should it be actually written?
Best,
Oivind A Nilsen
. use https://www.stata-press.com/data/r17/estatus
. xtset id
. qui xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner
. lincom _b[/:var(u1)]
( 1) [/]var(u1) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .8587807 .1090216 7.88 0.000 .6451022 1.072459
------------------------------------------------------------------------------
. lincom _b[/:var(u2)]
( 1) [/]var(u2) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .7370366 .1388917 5.31 0.000 .4648138 1.009259
------------------------------------------------------------------------------
. lincom _b[/:var(u1)] - _b[/:var(u2)]
( 1) [/]var(u1) - [/]var(u2) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .1217441 .1693622 0.72 0.472 -.2101996 .4536879
------------------------------------------------------------------------------
. constraint 1 _b[/:var(u1)] = _b[/:var(u2)]
. constraint 2 var(u1) = var(u2)
. xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner, re constraint(1)
(note: constraint number 1 caused error r(111))
:
:
. xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner, re constraint(2)
(note: constraint number 2 caused error r(133))
:
:
I try to put constraints on the variance of the random effects in the xtmlogit command. I either get error r(111) or r(133). How should it be actually written?
Best,
Oivind A Nilsen
. use https://www.stata-press.com/data/r17/estatus
. xtset id
. qui xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner
. lincom _b[/:var(u1)]
( 1) [/]var(u1) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .8587807 .1090216 7.88 0.000 .6451022 1.072459
------------------------------------------------------------------------------
. lincom _b[/:var(u2)]
( 1) [/]var(u2) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .7370366 .1388917 5.31 0.000 .4648138 1.009259
------------------------------------------------------------------------------
. lincom _b[/:var(u1)] - _b[/:var(u2)]
( 1) [/]var(u1) - [/]var(u2) = 0
------------------------------------------------------------------------------
estatus | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .1217441 .1693622 0.72 0.472 -.2101996 .4536879
------------------------------------------------------------------------------
. constraint 1 _b[/:var(u1)] = _b[/:var(u2)]
. constraint 2 var(u1) = var(u2)
. xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner, re constraint(1)
(note: constraint number 1 caused error r(111))
:
:
. xtmlogit estatus i.hhchild age hhincome i.hhsigno i.bwinner, re constraint(2)
(note: constraint number 2 caused error r(133))
:
:

Comment