Log likelihood and deviance not displayed

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
laura
Posts: 12
Joined: Wed May 18, 2011 2:37 pm

Log likelihood and deviance not displayed

Post by laura »

Hello,

I've had a couple of models today that appear to run, no error messages and sensible numbers in the output, but no Log Likelihood or Deviance is displayed in the output. Example below:

Run time (seconds) = 3.67
Number of iterations = 8
Log likelihood = .
Deviance = .

If I tweak a few things in the model, the likelihood and deviance get displayed.

I don't know whether this is a problem with my model (seems most likely to me, especially since whenever it does this, it seems to stop after an unusually small number of iterations) - in which case I'm not sure why no error message comes up - or if for some reason likelihood has been calculated but is not being displayed?

Happy to send code/data if useful

Thanks,
Laura
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Log likelihood and deviance not displayed

Post by GeorgeLeckie »

Hi Laura,

Yes, if you can email me a small do-file and dataset which replicates the bug you describe that would help us fix it.

If the model is unstable or missspecified you may have an extreme or non-sensical log-likelihood value which gets reset to Stata's system missing value when we import the MLwiN model results back to Stata.

You can check what is going on in MLwiN by leaving the nopause option off when you issue the runmlwin command. You can then inspect what the log-likelihood value is in MLwiN before runmlwin attempts to import the results back to Stata.

Best wishes

George
laura
Posts: 12
Joined: Wed May 18, 2011 2:37 pm

Re: Log likelihood and deviance not displayed

Post by laura »

Hi George,

Just checked in mlwin and it says it can't calculate the likelihood there, so it must be a problem with the model. I guess we all just need to check the runmlwin model output carefully to check this, as it would be easy to miss if the coefficients/SEs look reasonable!

Thanks,
Laura
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Log likelihood and deviance not displayed

Post by ChrisCharlton »

We have added a warning message for when the likelihood is missing. This will appear in the next release of runmlwin. If you could still send us an example of this we will be able to test that this works.
laura
Posts: 12
Joined: Wed May 18, 2011 2:37 pm

Re: Log likelihood and deviance not displayed

Post by laura »

Fantastic, thanks. Have just emailed you a dataset and model code
best wishes,
Laura
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Log likelihood and deviance not displayed

Post by GeorgeLeckie »

Thanks Laura,

I have just given this a go and the warning message works as expected.

One point to note is that when you have models which have many sets of random effects (you have 4 sets of random effects at level 2 and 2 sets at level 1)
it is good practice to run a series of increasingly complex models where you use the parameter estimates from the previous model as starting values for the next model. You are far less likely to run into estimation problems if you do this. Put in the most important sets of random effects first and then gradually introduce the less important sets.

Best wishes

George
Post Reply