Constraints for cross-classification

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
sujust18
Posts: 6
Joined: Wed Dec 05, 2012 4:54 pm

Constraints for cross-classification

Post by sujust18 »

Hello,

I would like to fit a multilevel model with binary responses and a crossed effect.
My data is structured as follows: level1: approx. 800 loans, level2: 700 borrowers, level3: crossed effects because borrowers can be clustered by 15 agents or 20 regions.

I declare a fourth level, create dummy variables for each region and constrain the variances to be equal:

forvalues i = 2/20 {
constraint define `i' [RP3]var(s`i') = [RP3]var(s1)
}

runmlwin def cons, level4(cons: s1-s20, diagonal) level3(agent: cons) level2(borrower: cons) level1(loan) discrete(distribution(binomial) link(logit) denominator(cons)) c(2/20)

I get the following error:
(note: constraint number 2 caused error r(111))
...
(note: constraint number 20 caused error r(111))
matrix e(Cns) not found

I would highly appreciate recommendations on how to solve this problem.
I'm using the manual, stata log-files and the presentation slides. Is there more information available on cross-classification with binary responses that I've missed so far?

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

Re: Constraints for cross-classification

Post by GeorgeLeckie »

Hi Susan,

Your constraints should be at level 4, not level 3, so you should write

Code: Select all

forvalues i = 2/20 {
    constraint define `i' [RP4]var(s`i') = [RP4]var(s1)
}
not

Code: Select all

forvalues i = 2/20 {
    constraint define `i' [RP3]var(s`i') = [RP3]var(s1)
}
However, more generally, I would recommend that you fit the model by MCMC as it is computationally more efficient and more extendable for cross-classified models. Also, your response is binary and so MLwiN will use quasilikelihood methods which produce only approximate estimates. MCMC does not suffer from the same biases. Suggest you read the chapter 15 of the MCMC manual. Also see

http://www.bristol.ac.uk/cmm/media/runm ... Models.log


Best wishes

George
Post Reply