Problems fitting PQL2 logit model

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
LisaAsch
Posts: 5
Joined: Thu Jan 09, 2014 3:48 pm

Problems fitting PQL2 logit model

Post by LisaAsch »

Hi runmlwin forum.

I am having problems fitting a simple 3-level logit model using the PQL2 estimator.
I first fit the model M1 using MQL1:

Code: Select all

runmlwin noharm cons, ///
level3(msoa01: cons) ///
level2(hhid: cons) ///
level1(subjectid: , weightvar(pw1)) ///
discrete(distribution(binomial) link(logit) denominator(cons)) ///
maxiterations(200) nopause
I then try to run the following model M2 with PQL2:

Code: Select all

runmlwin noharm cons, ///
level3(msoa01: cons) ///
level2(hhid: cons) ///
level1(subjectid: ) ///
discrete(distribution(binomial) link(logit) denominator(cons) pql2) ///
maxiterations(100) initsprevious nopause
Which gives me the following error message:
runmlwin has encountered an error importing the model results from MLwiN. Check that the model has run properly in ML
> wiN.
r(198);

I exclude nopause to see what's in MLWin, and find the following:
Output error message.JPG
Output error message.JPG (48.24 KiB) Viewed 9036 times
So Q1: What does this mean?

I tried dropping the weights and using MCMC. This works fine. The syntax of M3 uses starting values from M1

Code: Select all

runmlwin noharm cons, ///
level3(msoa01: cons) ///
level2(hhid: cons) ///
level1(subjectid: ) ///
discrete(distribution(binomial) link(logit) denominator(cons)) ///
mcmc(burnin(1000) chain(10000))  initsprevious nopause nogroup
I also tried dropping the household level (M4 and M5):

Code: Select all

runmlwin noharm cons, ///
level2(msoa01: cons) ///
level1(subjectid: , weightvar(pw1)) ///
discrete(distribution(binomial) link(logit) denominator(cons)) ///
maxiterations(100) nopause

runmlwin noharm cons, ///
level2(msoa01: cons) ///
level1(subjectid: , weightvar(pw1)) ///
discrete(distribution(binomial) link(logit) denominator(cons) pql2) ///
maxiterations(200) initsprevious nopause
This also worked fine.

So Q2 is: I need to account for the household level because it was a household clustered survey. But I have no real interest in variation at this level. Is there anyway of accounting for cluster without making it a level in MLWIN? I.e. estimating robust standard errors as is possible with svyset in stata?

Many thanks,
Lisa
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Problems fitting PQL2 logit model

Post by GeorgeLeckie »

Hi Lisa,

You have individuals within households within neighbourhoods. I suspect that your data are rather extreme. You clearly will have very few individuals per household and the response is presumably also very rare and so in many households no one self harms. I suspect that your models are struggling to estimate the household variance. The fact that you are specifying a very high number of iterations for all your models also suggests that you have a general convergence difficulty with these data.

Note that M2 does not include the level-1 weights, but M1 does.Both M1 and M2 should be exactly the same except that you specify MQL1 for the first model and PQL2 for the second. Have you tried fitting the intermediate MQL2 and PQL1 models which should prove easier to converge than the PQL2 model. You can then use the estimates of these intermediate models to provide starting values for the PQL2 model.

Alternatively, you could try fitting your models with the -melogit- command

George
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Problems fitting PQL2 logit model

Post by ChrisCharlton »

To answer your question about robust standard errors - you can turn these on with the fpsandwich and rpsandwich options in the runmlwin command (see the runmlwin help files). These are also on my default if you specify weights.
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Problems fitting PQL2 logit model

Post by GeorgeLeckie »

Note that these are cluster-robust standard errors where the clusters are whatever the highest level units are.
Best wishes
George
LisaAsch
Posts: 5
Joined: Thu Jan 09, 2014 3:48 pm

Re: Problems fitting PQL2 logit model

Post by LisaAsch »

Many many thanks to both of you for your thorough responses.

Indeed my data are rather extreme and this is probably what caused the convergence problems. Having checked the distribution I had zero cell counts at level 3 for several MSOAs.

For my second question, it's good to hear that using fp- and rpsandwich is an alternative. I can't seem to find any syntax examples using these in the help-files however - are they simply specified at the end of the model syntax? And does this mean that it applies cluster robust standard errors based on the highest level (in my case level 3), and that I wouldn't be able to apply them for level 2 - households in my case?

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

Re: Problems fitting PQL2 logit model

Post by GeorgeLeckie »

Hi Lisa,

Yes specifying fpsandwich and rpsandwich give cluster-robust standard errors using the highest-level units at the clusters.
By allowing for arbitrary correlation between measurements within a level-3 unit, you are implicitly allowing for arbitrary correlation between measurements within a level-2 unit as each level-2 unit is nested within a level-3 unit.

There are no syntax examples of using fpsandwich and rpsandwich, but these options and their usage are documented in the runmlwin help file. They are listed under general options, so yes use issue them at the end of the model syntax. For example...

Code: Select all

use "http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial.dta", clear

generate pass = (normexam>0)

runmlwin pass cons standlrt i.schgend, ///
	level2(school: cons) ///
	level1(student:) ///
	discrete(distribution(binomial) link(logit) denom(cons) pql2) ///
	fpsandwich rpsandwich nopause



Best wishes

George
LisaAsch
Posts: 5
Joined: Thu Jan 09, 2014 3:48 pm

Re: Problems fitting PQL2 logit model

Post by LisaAsch »

Brilliant. Thanks so much for this.
Post Reply