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.
Constraints for cross-classification
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Constraints for cross-classification
Hi Susan,
Your constraints should be at level 4, not level 3, so you should write
not
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
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)
}
Code: Select all
forvalues i = 2/20 {
constraint define `i' [RP3]var(s`i') = [RP3]var(s1)
}
http://www.bristol.ac.uk/cmm/media/runm ... Models.log
Best wishes
George