Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: stata to winbugs


From   "David Harrison" <David@icnarc.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: stata to winbugs
Date   Fri, 5 Nov 2004 09:52:04 -0000

A while ago, I produced the following program which produces a rectangular format with variable names at the top - haven't used it for a long time and I can't remember how well it works, but feel free to play with it! The -list- option just puts an S-plus format list at the top of the file for specifying constants etc.

David
david@icnarc.org

program define outbugs
    version 8
    syntax [varlist] [if] [in] using/ [, list(string) noLabel replace ]
	if index("`using'",".")==0 {
        local using "`using'.txt"
    }
	foreach v of varlist `varlist' {
        char `v'[varname] "`v'[]"
    }
    set more off
	qui log using `"`using'"', text `replace'
    if "`list'"!="" {
        di as result _n "list(`list')"
    }
    set linesize 255
	list `varlist' `if' `in', subvarname clean noobs abbreviate(33) `label'
    qui log close
end

-----Original Message-----
From: E. Michael Foster [mailto:foster@pop.psu.edu]
Sent: 04 November 2004 16:36
To: statalist@hsphsun2.harvard.edu
Subject: st: stata to winbugs


Hi,
  Does anyone have a handy-dandy do file for exporting STATA data into a
format WinBugs can read? 
thanks,
Michael

E. Michael Foster
Professor of Health Policy and of Demography
Methodology Center and Department of Health Policy
Penn State


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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