Error fitting Multinomial logit using PQL2

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/

Error fitting Multinomial logit using PQL2

Postby jmflavel » Mon Jun 18, 2012 6:45 am

Hello
I ran a 2 level multinomial logit using MQL and then tried to fit it using PQL2 but keep receiving an error message.

My syntax is set out as follows:

Code: Select all
runmlwin depvar varlist, level2(id:cons) level1(tpid) discrete(distribution(multinomial) link(mlogit) denominator(cons) basecategory(2)) maxiterations(100) nopause



Code: Select all
runmlwin depvar varlist, level2(id:cons) level1(tpid) discrete(distribution(multinomial) link(mlogit) denominator(cons) basecategory(2) pql2) maxiterations(100) initsprevious nopause


The first line runs successfully but the second does not. It comes back with an error saying that WARNING: IGLS algorithm failed to converge. Increase the number of iterations. See the maxiterations() option.

When I check the output it says only 6 iterations were run even though I set maxiterations at 100. Can anybody please advise where I have gone wrong?
Thanks
jmflavel
 
Posts: 8
Joined: Sun Jun 10, 2012 4:39 am

Re: Error fitting Multinomial logit using PQL2

Postby ChrisCharlton » Mon Jun 18, 2012 5:36 pm

I would suggest running the command again, but without the nopause option so that you can check what's in the equations window. It's possible that one or more of the results have gone to an invalid number, such as infinity.
ChrisCharlton
 
Posts: 211
Joined: Mon Oct 19, 2009 11:34 am

Re: Error fitting Multinomial logit using PQL2

Postby GeorgeLeckie » Tue Jun 19, 2012 9:03 am

Hi,

You have used the initsprevious option to use the MQL1 estimates for your model as starting values for fitting the model by PQL2. This is sensible as it cuts down on convergence issues.

Another way to cut down on convergence issues is to build up the model gradually. Fit a simple model, then add some more covariates and refit using the estimates from the previous model as starting values for the current model. This is particularly important in models with complex random parts.

Best wishes

George
*************************
George Leckie
runmlwin developer
Centre for Multilevel Modelling
*************************
GeorgeLeckie
Site Admin
 
Posts: 212
Joined: Fri Apr 01, 2011 3:14 pm

Re: Error fitting Multinomial logit using PQL2

Postby jmflavel » Sun Jun 24, 2012 5:25 am

Thank you both for your replies. I have followed both of your suggestions. I was able to get estimates fitted using PQL2 when I omitted the nopause option but I cannot get results within Stata using runmlwin, I can only get them from within MLwiN. There is very little difference between the MQL1 and PQL2 results

I also ran into a new problem. The next extension of my model (after fitting using PQL2) was to fit it using MCMC. I have not been able to successfully do this. I tried to run it within MLwiN following PQL2 but received error messages, firstly that it could not run without NOPAUSE-I think the message said something about OBEY, then a second error message said it couldn't run because the prior variance matrix was not positive definite

I am in the process of running the same model using gllamm in Stata but was hoping to get results using MLwiN for comparison. I did read this past post where George gave some very useful advice

viewtopic.php?f=3&t=270

I will have to go and do some investigating but just wanted to post my thanks for your responses
jmflavel
 
Posts: 8
Joined: Sun Jun 10, 2012 4:39 am

Re: Error fitting Multinomial logit using PQL2

Postby GeorgeLeckie » Mon Jun 25, 2012 6:25 pm

Hi Jurjen,

You say

I was able to get estimates fitted using PQL2 when I omitted the nopause option but I cannot get results within Stata using runmlwin, I can only get them from within MLwiN.


This sounds strange. If you can fit the model using PQL2 when you use the nopause option then the results should be returned to Stata when you click the "Resume Macro" button for the second time. What happens when you click the "Resume Macro" button for the second time?

You say

The next extension of my model (after fitting using PQL2) was to fit it using MCMC.


The MQL1 estimates are normally good enough starting values for MCMC, so no need to get PQL2 estimates for this purpose.

You say that you get the following error message

the prior variance matrix was not positive definite


You typically get this message when you provide nonsensical starting values for the MCMC chain. For example negative variances or when the model includes random coefficients, correlations which do not lie in the range -1 to +1. This might happen if the model you have fitted by MQL1/PQL2 has had convergence difficulties and has given nonsensical estimates. Check that the starting values you are providing are sensible

Best wishes

George
*************************
George Leckie
runmlwin developer
Centre for Multilevel Modelling
*************************
GeorgeLeckie
Site Admin
 
Posts: 212
Joined: Fri Apr 01, 2011 3:14 pm

Re: Error fitting Multinomial logit using PQL2

Postby jmflavel » Sat Jun 30, 2012 3:04 am

Thanks George. I was able to run mcmc using MQL1 results as starting values. I did check for nonsensical values first but the starting values look quite reasonable. I'm not sure why
i was having difficulty before but am grateful for your advice which has helped solve my problem

Thanks again

Regards
Joanne
jmflavel
 
Posts: 8
Joined: Sun Jun 10, 2012 4:39 am

Re: Error fitting Multinomial logit using PQL2

Postby GeorgeLeckie » Thu Jul 05, 2012 6:14 pm

That's good news, I'm glad runmlwin is working for you again
George
*************************
George Leckie
runmlwin developer
Centre for Multilevel Modelling
*************************
GeorgeLeckie
Site Admin
 
Posts: 212
Joined: Fri Apr 01, 2011 3:14 pm


Return to runmlwin user forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron