savewsz -- Save Stata dataset as MLwiN worksheet
Save data in memory to MLwiN worksheet
savewsz [filename] [, savewsz_options]
savewsz_options Description ------------------------------------------------------------------------- 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 -------------------------------------------------------------------------
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.
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\MLwiN v2.26\i386\mlwin.exe).
replace permits savewsz to overwrite an existing worksheet.
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:
http://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\MLwiN v2.26\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.
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
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