*! savewsz.sthlp, Chris Charlton and George Leckie

Title

savewsz -- Save Stata dataset as MLwiN worksheet

Syntax

Save data in memory to MLwiN worksheet

savewsz
[filename]
[,
savewsz_options]

savewsz_options

forcerecast forces a recast of all variables saved as long or double to float

batch prevents any MLwiN GUI windows being displayed

nolabel omit value labels from the saved worksheet

version(#) MLwiN file version

nocompress do not compress data

mlwinpath(string) mlwin.exe file address, including the file name

replace overwrite existing worksheet

Description

savewsz stores the dataset currently in memory as an MLwiN worksheet under the name
filename. If filename is not specified, the name under which
the data were last known to Stata (c(filename)) is used. If
filename is specified without an extension, .wsz or .ws is used depending on
whether compression is requested. If your
filename contains embedded spaces, remember to enclose it in double
quotes.

Options for savewsz

forcerecast forces a recast of all variables saved as long or double to float.

batch prevents any MLwiN GUI windows being displayed.

nolabel omits value labels from the saved worksheet.

version(#) selects the worksheet version to use. Possible values are:

1: MLwiN 1.00 worksheet

2: MLwiN 1.10 worksheet

3: MLwiN 2.00 worksheet

4: Current MLwiN version worksheet

nocompress prevents the MLwiN worksheet from being saved in compressed format.

mlwinpath(string) specifies the file address for mlwin.exe, including the file name.
For example: mlwinpath(C:\Program Files (x86)\MLwiN v2.31\i386\mlwin.exe).

replace permits savewsz to overwrite an existing worksheet.

Remarks

In order to get savewsz working, the user must then:

(1) install the latest version of MLwiN on their computer;

(2) set the MLwiN path using mlwinpath(string) or a global macro called MLwiN_path.

If you don't have the latest version of MLwiN, visit:

https://www.bristol.ac.uk/cmm/software/mlwin.

MLwiN is free for UK academics (thanks to support from the UK Economic and Social Research Council).
A fully unrestricted 30-day trial version is available for non-UK academics.

Advanced users may wish to set the MLwiN path every time Stata is started by simply inserting the following line into the profile do-file profile.do.
See profile.

. global MLwiN_path "C:\Program Files (x86)\MLwiN v2.31\i386\mlwin.exe"

Where you must substitute the MLwiN path that is correct for your computer for the path given in quotes in the above example.

Examples

Setup

. sysuse auto, clear

Save data in memory to MLwiN worksheet

. savewsz myauto

Resave myauto after changing the data

. generate price1000 = price/1000

. savewsz myauto, replace

Equivalent to above command

. savewsz, replace

About the Centre for Multilevel Modelling

The MLwiN software is developed at the Centre for Multilevel Modelling.
The Centre was established in 1986, and has been supported largely by project grants from the UK Economic and Social Research Council.
The Centre has been based at the University of Bristol since 2005.

The Centre’s website:

https://www.bristol.ac.uk/cmm

contains much of interest, including new developments, and details of courses and workshops.
This website also contains the latest information about the MLwiN software, including upgrade information,
maintenance downloads, and documentation.

The Centre also runs a free online multilevel modelling course:

https://www.bristol.ac.uk/cmm/learning/course.html

which contains modules starting from an introduction to quantitative research progressing to multilevel modelling of
continuous and categorical data.
Modules include a description of concepts and models and instructions of how to carry out analyses in MLwiN, Stata and R.
There is a also a user forum, videos and interactive quiz questions for learners’ self-assessment.

How to cite runmlwin and MLwiN

runmlwin is not an official Stata command.
It is a free contribution to the research community, like a paper.
Please cite it as such:

Leckie, G. and Charlton, C. 2013. runmlwin - A Program to Run the MLwiN Multilevel Modelling Software from within Stata. Journal of Statistical Software, 52 (11),1-40.
https://www.jstatsoft.org/v52/i11

Similarly, please also cite the MLwiN software:

Rasbash, J., Charlton, C., Browne, W.J., Healy, M. and Cameron, B. 2009. MLwiN Version 2.1. Centre for Multilevel Modelling,
University of Bristol.

For models fitted using MCMC estimation, we ask that you additionally cite:

Browne, W.J. 2012. MCMC Estimation in MLwiN, v2.26. Centre for Multilevel Modelling, University of Bristol.

The runmlwin user forum

Please use the runmlwin user forum to post any questions you have about runmlwin.
We will try to answer your questions as quickly as possible, but where you know the answer to another user's question please also reply to them!

https://www.cmm.bristol.ac.uk/forum/

Authors

Chris Charlton

Centre for Multilevel Modelling

University of Bristol

c.charlton@bristol.ac.uk

George Leckie

Centre for Multilevel Modelling

University of Bristol

Also see

Online: runmlwin, mcmcsum, usewsz