Zhiyong Zhang's Psychometric Website
 
Home Control Panel Login Register Search Submit Logout About me Contact me
My Research
Google
Web
This Site
Home > My Research > SAS WinBUGS > SAS WinBUGS using multiple chains
SAS WinBUGS using multiple chains
2009-11-26          Read: 5751 times
Cite this page: (2009). SAS WinBUGS using multiple chains. Retrieved December 16, 2018, from http://www.psychstat.org/us/article.php/86.htm.
SAS WinBUGS using multiple chains

Please cite this using

Zhang, Z., McArdle, J. J., Wang, L., & Hamagami, F. (2008). A SAS interface for Bayesian analysis with WinBUGS. Structural Equation Modeling, 15(4), 705?C728.

Using the linear regression model example (http://www.psychstat.org/us/article.php/73.htm), the method with two chains are specified as following.

/*Create the initial values - Starting values should be carefully chosen.*/

/*Starting values for chain 1*/
DATA _NULL_;
FILE "c:\RegInit1.txt";
PUT "list(b0=0, b1=0, b2=0, Inv_sig2_e=1)";
RUN;

/*Starting values for chain 2*/
DATA _NULL_;
FILE "c:\RegInit2.txt";
PUT "list(b0=5, b1=5, b2=5, Inv_sig2_e=5)";
RUN;

/*Create a script file that includes the command to be used in WinBUGS*/
DATA _NULL_;
FILE "C:\Programs\WinBUGS14\BatchReg.txt";
PUT // @@
#1 "display('log')"
#2 "check('c:/RegModel.txt')"
#3 "data('c:/RegData.txt')"
#4 "compile(2)"
#5 "inits(1, 'c:/RegInit1.txt')"
#6 "inits(2, 'c:/RegInit2.txt')"
#7 "gen.inits()"
#8 "update(2000)"
#9 "set(b0)"
#10 "set(b1)"
#11 "set(b2)"
#12 "set(Sig2_e)"
#13 "dic.set()"
#14 "update(5000)"
#15 "dic.stats()"
#16 "coda(*,'c:/output')"
#17 "save('c:/bugslog.txt')"
#18 "quit()"
;
RUN;

Submitted by: johnny
Add a comment View comment Add to my favorite Email to a friend Print
If you want to rate, please login first, or click here to register. Or you can use USERNAME: guest and PASSWORD: guest to log in.
Average score 0, based on 0 comments
1 2 3 4 5 6 7 8 9 10
Copyright © 2003-13 Zhiyong Zhang \'s Psychometric Website
Maintained by Zhiyong Zhang