Page 1 of 1

Constraints for cross-classification

Posted: Wed Dec 05, 2012 6:09 pm
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.

Re: Constraints for cross-classification

Posted: Mon Dec 10, 2012 4:43 pm
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