UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

MLwiN FAQ
How can I convert a Stata data file to an MLwiN data file?

You can view this FAQ as a movie using the Real Media player.

We have created a program called stata2mlwin that you can use to convert your Stata program into an MLwiN program that you can run to create a MLwiN data file.

Note that stata2mlwin now creates an additional variable called cons which is a column of 1s, which can be used for including a constant in the equations window in MLwiN (unless you already have such a variable or specify the nocons option).

You can download stata2mlwin by typing findit stata2mlwin (see How can I use the findit command to search for programs and get additional help? for more information about using findit).

Say we want to convert the a file called c:\data\hsb2.dta to an MLwiN data file.  After installing stata2mlwin, you would type this.

stata2mlwin using c:\data\hsb2

Then you would start MLwiN and click Data Manipulation then Command Interface and then enter the wipe command and then obey c:\data\hsb2.obe (substituting c:\data\hsb2.obe with the name of your file).  This then reads the data into MLwiN (including variable names and value labels). 

We can then click on Data Manipulation then Names to see the names of the variables to check to see if they were read in properly.

We can then click File then Save Worksheet As... and then save this data file as a MLwiN data file.


How to cite this page

Report an error on this page or leave a comment

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California