Page 1 of 1

==: operator invalid

Posted: Wed Jun 15, 2016 3:43 pm
by IgnacioA
Hi there!

I'm trying to run the following model:

runmlwin costetotal_p cons noini_1 costetotal_ajt, ///
level3 (idc: cons) ///
level2 (idm: cons) ///
level1 (idpr:) ///
discrete(distribution(normal) link(id) pql2) ///
mlwinsettings(optimat) ///
nopause

After 20 minutes STATA gives me the number of subject in each cluster and the following error: "==: operator invalid"

The sample size is around 1.6 million of subjects, dependent variable is continous, I have checked variables and none of them have missing or string values.

I ran a related analysis with the same database, however the dependent variable was dichotomous and the syntaxis was slightly different but the model ran perfectly.

Where could be the problem?

Thanks a lot!

Re: ==: operator invalid

Posted: Wed Jun 15, 2016 4:11 pm
by ChrisCharlton
If Stata has started to display the model output then this suggests that the model has run and that the problem is with the code to display the results. Could you confirm this with the following commands?:

Code: Select all

ereturn list
to check that the results have been returned from MLwiN and

Code: Select all

ereturn display
to attempt to display them using Stata's default model results display.

Re: ==: operator invalid

Posted: Thu Jun 16, 2016 11:17 am
by IgnacioA
Thank you Chirs,

I have ran the commands you advice me and the results are the following:

. ereturn list

scalars:
e(numlevels) = 3
e(k_f) = 3
e(k_r) = 2
e(k) = 5
e(size) = 203827
e(maxlevels) = 4
e(columns) = 1500
e(variables) = 4
e(tempmat) = 0
e(extrabinomial) = 0
e(iterations) = 5
e(converged) = 1
e(N) = 1678937
e(time) = 1179.634

macros:
e(weighttype) : "standardised standardised standardised"
e(weightvar) : ". . ."
e(ivars) : "idc idm"
e(level1var) : "id"
e(title) : "Normal response model"
e(linearization) : "PQL2"
e(method) : "IGLS"
e(properties) : "b V"
e(link) : "identity"
e(distribution) : "normal"
e(depvars) : "costetotal_post"
e(version) : "2.33"
e(cmdline) : "runmlwin costetotal_p cons noini_1 costetotal_ajt, level3 (idc: cons) .."
e(cmd) : "runmlwin"

matrices:
e(b) : 1 x 5
e(V) : 5 x 5
e(g_max) : 1 x 2
e(g_avg) : 1 x 2
e(g_min) : 1 x 2
e(N_g) : 1 x 2
e(RP2) : 1 x 1
e(RP3) : 1 x 1

functions:
e(sample)

. ereturn display
--------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
FP1 |
cons | 810.4965 27.7417 29.22 0.000 756.1238 864.8692
noini_1 | 60.34194 44.20632 1.37 0.172 -26.30086 146.9847
costetotal_ajt | .8315273 .0208635 39.86 0.000 .7906355 .8724191
---------------+----------------------------------------------------------------
RP3 |
var(cons) | 844.3603 9229.189 0.09 0.927 -17244.52 18933.24
---------------+----------------------------------------------------------------
RP2 |
var(cons) | 2753519 48345.43 56.96 0.000 2658763 2848274
--------------------------------------------------------------------------------

I do not know where the issue is, could you light me?

Thanks.

Re: ==: operator invalid

Posted: Thu Jun 16, 2016 11:30 am
by ChrisCharlton
I expect that the problem will be somewhere in the runmlwin_display function in runmlwin.ado. Would you be able to provide the exact output that is displayed before the problem occurs so that we can try to determine which part?

Re: ==: operator invalid

Posted: Thu Jun 16, 2016 12:35 pm
by IgnacioA
Please, find below the command and the output generated before executing it:

runmlwin costetotal_p cons noini_1 costetotal_ajt, ///
> level3 (idc: cons) ///
> level2 (idm: cons) ///
> level1 (id:) ///
> discrete(distribution(normal) link(id) pql2) ///
> mlwinsettings(optimat) ///
> nopause

MLwiN 2.33 multilevel model Number of obs = 1678937
Normal response model
Estimation algorithm: IGLS, PQL2

-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
idc | 290 2 5789.4 17001
idm | 6729 1 249.5 995
-----------------------------------------------------------

Run time (seconds) = 1179.63
Number of iterations = 5
==: operator invalid
r(198);

Thanks again.

Re: ==: operator invalid

Posted: Thu Jun 16, 2016 12:51 pm
by ChrisCharlton
Thanks for the additional information, I have now been able to replicate the problem. -runmlwin- is confused because you have specified that you have a discrete response, but then said that the distribution is normal with:

Code: Select all

discrete(distribution(normal) link(id) pql2)
This results in the model being fitted as having a normal response, but without a level-1 variance, giving an invalid likelihood and causing the display error that you are seeing. The solution is to just to remove the discrete option entirely so that the model is fitted as having a normal outcome.

Re: ==: operator invalid

Posted: Thu Jun 16, 2016 1:41 pm
by IgnacioA
Thanks a lot! It works perfectly