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
Log likelihood and deviance not displayed
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Log likelihood and deviance not displayed
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
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
Re: Log likelihood and deviance not displayed
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
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
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: Log likelihood and deviance not displayed
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.
Re: Log likelihood and deviance not displayed
Fantastic, thanks. Have just emailed you a dataset and model code
best wishes,
Laura
best wishes,
Laura
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Log likelihood and deviance not displayed
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
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