Running a MACRO, model setup, multiple membership

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software 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!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
drddtorres
Posts: 27
Joined: Thu May 30, 2013 7:19 pm

Running a MACRO, model setup, multiple membership

Post by drddtorres »

Okay, I have three questions. First, about the data. I have repeated measures on students nested within schools. Children are allowed to change schools, so I ultimately desire a multiple membership setup. Also, one of my predictors is endogenous, so I'm hoping to make use of Tony Fielding's -ivmlwin- macro. While the user guide is helpful, I'm stuck on some points.

1. I've downloaded the macros (they are .txt files), but don't necessarily understand how mlwin calls them up. Can someone guide me here?

2. I've gotten as far as setting up a basic model, but I want to move on to adding level-2 and level-3 variables. How do I do this using the "Add Term" button in the equations window? Everything I add is included in the time-varying portion of the model.

3. Has anyone gone about setting up their data to handle multiple membership? If so, I'd appreciate a step-by-step explanation of creating the weighted indicator variables needed to handle this issue.

Thanks very much,
Diego
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Running a MACRO, model setup, multiple membership

Post by ChrisCharlton »

1) The macros are run via MLwiN's PRE and POST file system (set via Options->Directories). This means that the macro set to be the PRE file is run before each (R)IGLS iteration and the macro set as POST is run at the end of the iteration. For these particular macros this is just used as a convenient way to run them as the PRE macro doesn't rely on previous estimates and the POST macro checks for convergence before doing its work and therefore only does anything at the end of the iterations.

2) MLwiN should work out what level a variable is at (you can check this by looking at the subscripts). If you want to make a variable random at a level you can click on the corresponding element in the equations window you should get a dialogue box where you can tick the levels on or off.

3) For setting up a multiple membership model with (R)IGLS see chapter 19 of the user guide (http://www.bris.ac.uk/cmm/software/mlwi ... al-web.pdf). For MCMC see chapter 16 of the MCMC guide (http://www.bris.ac.uk/cmm/software/mlwi ... mc-web.pdf). Note, the macros that you mentioned will not work in conjunction with MCMC estimation.
drddtorres
Posts: 27
Joined: Thu May 30, 2013 7:19 pm

Re: Running a MACRO, model setup, multiple membership

Post by drddtorres »

Thanks, Chris.

More on 1. Are the macros run automatically or do I need to run them myself? Further, for the model setup, is the point to include my endogenous variable in the equations window because the macro will note that is to be instrumented? I'm thinking of Fielding's readme.txt file.

I'm not fully comprehending your answer to question 2. Do you mean that MLwiN should automatically set my level two and level three variables to their exact location in the equation?

I have chapter 19, but was getting lost in the code. I'll see what I can do today on resolving my issues.

Someone needs to write MLwiN for Dummies. :lol:
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Running a MACRO, model setup, multiple membership

Post by ChrisCharlton »

Once you have specified the PRE and POST files under Options->Directories these are run automatically for you.

When you run the model with these particular macros enabled for the first time it creates an 'IVSET' column with a row for each of the variables in your model. You need to edit this to contain the corresponding column numbers that you want to use as your instrumental variables. Once you have done this you will need to run the model again.

MLwiN checks variables that you add to the model and if they don't vary within a higher level unit it changes the subscripts to indicate that they are higher level variables, i.e. if you have a level two variable it would have a j subscript rather than ij.
drddtorres
Posts: 27
Joined: Thu May 30, 2013 7:19 pm

Re: Running a MACRO, model setup, multiple membership

Post by drddtorres »

Thanks again, Chris. I think I'm getting close to ready to execute an IV estimation with your help. I just need to do the multiple membership stuff and I'll try it. If I should run into any issues, I'll probably be back with more questions.

Allow me to ask another question. How are cross-level interactions completed in MLwiN? When I click "Add Term," am I doing the correct thing when I click the drop-down menu for order (I choose 1), then enter in the first box my level-1 variable denoting time (year) and in the second box my dummy for gender. Would that be the year x gender cross-level interaction? I tested it and it looks correct.

Does MLwiN produce a table of the estimates for easier interpretation? I'm so used to Stata and HLM and need my p-values. :D

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

Re: Running a MACRO, model setup, multiple membership

Post by ChrisCharlton »

Yes, your method of adding cross level interactions is correct. You can find more information about these in module 5 (section 4.2) of our on-line course (http://www.cmm.bris.ac.uk/lemma/).

MLwiN does have estimate tables (found under Model->Estimate Tables or by clicking "store" on the equations windows and then using Model->Compare Stored Models). These do not however report p-values, if you want these you will either have to calculate them yourself or run MLwiN through a wrapper that does report them such as http://www.bristol.ac.uk/cmm/software/runmlwin/ (for Stata) or http://www.bristol.ac.uk/cmm/software/r2mlwin/ (for R).
Post Reply