constraint in MVML 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
guobl
Posts: 22
Joined: Wed Nov 18, 2009 12:25 pm

constraint in MVML model

Post by guobl »

H Chris, George and all listers,
I am playing constraint for MVML model but the following code not working.

use "http://www.bristol.ac.uk/cmm/media/runmlwin/gcsemv1.dta", clear
constraint drop _all
constraint define 1 [RP1]var(cons_1) = var(cons_2) // equal level 1 variance for both Y variable
constraint define 2 _b(female_1)=_b(female_2) // equal coefficient across equation
runmlwin (written cons female, eq(1)) (csework cons female, eq(2)), ///
level2(school: (cons, eq(1)) (cons, eq(2))) ///
level1(student: (cons, eq(1)) (cons, eq(2))) constraint 1/2 nopause

option constraint incorrectly specified

I know how to set parameters equal if using MLwiN test and interval. any help here please? thanks.
ChrisCharlton
Posts: 1252
Joined: Mon Oct 19, 2009 10:34 am

Re: constraint in MVML model

Post by ChrisCharlton »

You may just be missing the brackets for the option. For example syntax using constraints see chapter 18 of the MLwiN User's guide replication script: http://www.bris.ac.uk/cmm/media/runmlwi ... d_Data.log.
guobl
Posts: 22
Joined: Wed Nov 18, 2009 12:25 pm

Re: constraint in MVML model

Post by guobl »

thank you Chris.
to share the tricks playing constraint for MVML model, I noticed when pickup a parameter, we need add equation numbers as suffix. see for example even variable female included only in equation 2, we still need use female_2 when coding constraint. originally I thought the suffix number was because they are included in all equations. because if the model not run, we can't use matrix list e(V) or e(b) get parameter name. hope its useful.
Post Reply