[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: new version for writing data in WinBUGS format

From   Darren Greenwood <>
To   "" <>
Subject   Re: st: new version for writing data in WinBUGS format
Date   Thu, 12 Nov 2009 17:13:08 +0000

In addition to the -bugwrite- and -bugsdat- programs, for those interested in using WinBUGS (or BUGS or OpenBUGS) with Stata, it's worth looking up -bugsdat2- in the bugsutils package and -wbdata- in the winbugsfromstata package. These two packages contain enough programs to allow the user to export data from stata to winbugs, call winbugs and run script, return results to Stata, and the latter also contains comprehensive diagnostics after running the script.

Best wishes,


Darren Greenwood
Senior Lecturer in Biostatistics
Biostatistics Unit
Centre for Epidemiology & Biostatistics
Level 8, Worsley Building
University of Leeds. 
Leeds. LS2 9JT
tel: +44 (0)113 343 1813
fax: +44 (0)113 343 4877

Please note our short courses in biostatistics:

And our MSc in Statistical Epidemiology:

Date: Tue, 10 Nov 2009 10:04:52 -0600
From: "Feiveson, Alan H. (JSC-SK311)" <>
Subject: st: new version for writing data in WinBUGS format
Hello everyone - Thanks to Kit Baum, a new variation of a program for writing Stata data in a format that can be read by WinBUGS is now on the SSC. The new program, -bugwrite-, is similar to -bugsdat- but in some cases may be easier to use. 
More specifically, here are some differences:
Options -bugsdat- has that -bugwrite- does not:
1.Can write data as arrays (dim option),-bugwrite- only writes in long form.
2.Put user-specified text as the beginning of the file (data option), 
3.Change the names of variables in the output (name option).
Options that -bugwrite- has that -bugsdat- does not:
1.Allows [in] (as well as [if]),
2.Can display or suppress output to the screen or to a file as desired, whereas -bugsdat- automatically does both.
3.Can specify number of data columns of output (columns option)
4.Can specify the total width in number of characters (width option).
5.Other options for making it easier to view the layout (leftpad, rightpad, space options).
Other differences
- -bugwrite- displays/writes only the data as it normally appears in Stata (not including rounding errors), thus making it easier to view or check output. For example, 0.24 will be written as ".24", not ".239999994635582".

Al Feiveson, James Fiedler
*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index