Code:
webuse union.dta, clear xtset idcode year xtlogit union, vce(robust) re
The multilevel structure can be added using xtmelogit, but as I understand it, it is no longer part of the official stata which makes me a bit suspicious and also it doesn't allow me to use pweights (and it takes a really long time to run even for the empty model).
A good option seems to be melogit, but for some reason it doesn't converge even when I am using it to fit the empty model without the houdehold level as soon as I include the weights. The model looks like this (of course, there is no weighting variable in the union dataset. To illustrate the problem, I have created a weighting variable pw = 1, but with this, the model runs. So this is just an illustration of what my code looks like and unfortunately can't replicate the problem):
Code:
gen pw = 1 melogit union [pw=pw] || idcode:
Fitting fixed-effects model:
Iteration 0: log likelihood = -4.512e+08
Iteration 1: log likelihood = -4.500e+08
Iteration 2: log likelihood = -4.500e+08
Iteration 3: log likelihood = -4.500e+08
Refining starting values:
Grid node 0: log likelihood = .
Grid node 1: log likelihood = .
Grid node 2: log likelihood = .
Grid node 3: log likelihood = .
(note: Grid search failed to find values that will yield a log likelihood value.)
Fitting full model:
initial values not feasible
r(1400);
Iteration 0: log likelihood = -4.512e+08
Iteration 1: log likelihood = -4.500e+08
Iteration 2: log likelihood = -4.500e+08
Iteration 3: log likelihood = -4.500e+08
Refining starting values:
Grid node 0: log likelihood = .
Grid node 1: log likelihood = .
Grid node 2: log likelihood = .
Grid node 3: log likelihood = .
(note: Grid search failed to find values that will yield a log likelihood value.)
Fitting full model:
initial values not feasible
r(1400);
0 Response to pweight with melogit
Post a Comment