Subset of Data for Simulation

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
runner21
Posts: 5
Joined: Fri Feb 19, 2016 3:47 am

Subset of Data for Simulation

Post by runner21 »

I'm running a simulation study, and I have created my datasets in SAS. I have a total of 1,000 datasets, which I combined into one file that I imported into MLwiN. This file has a field that identifies the data set, numbered from 1 to 1,000, and my plan was to use this field to create a subset of the full data set, then run each data set individually in a loop and summarize across all 1,000 datasets.
However, I'm having trouble creating a subset. I thought that the CHOOse command would work, but I can't seem to keep all variables for each data set. Is there another way to do this, apart from importing each data set individually?
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Subset of Data for Simulation

Post by ChrisCharlton »

In MLwiN you can set up a zero/one indicator to exclude particular rows of data from the model. You can set this either with the EXCL command, or via the hierarchy window. I would suggest that probably the easiest way for you to switch between subsets would be to keep your data in the stacked format and then use this exclusion column to select each of your simulations. For example if your simulation indicator was called 'simulation' you would select the rows that belong to the first simulation with something like:

Code: Select all

NOTE change c100 to a free column in the dataset
CALC c100 = ('simulation' != 1)
EXCL c100
you could then fit your model and repeat this for each of your other simulations.
runner21
Posts: 5
Joined: Fri Feb 19, 2016 3:47 am

Re: Subset of Data for Simulation

Post by runner21 »

That worked- thank you!
Post Reply