[R] Help on using WinBUGS on Mac

Wayne (Yanwei) Zhang actuaryzhang at uchicago.edu
Tue Jan 19 03:23:06 CET 2010


Dear all,

I had trouble in setting up WinBUGS on my Mac, and I'm seeking for some help 
here. 

I followed the instruction by Tom Palmer here: 
http://www.ruudwetzels.com/MacBUGS/winbugsonmacosx.pdf

I installed Darwine 1.1.21, and downloaded WinBUGS14. However, when I 
double-clicked the WinBUGS14.exe file, a black-box dialog window poped up, 
and I got error message in the Wine log as follows:

fixme:keyboard:RegisterHotKey (0x10032,13,0x00000002,3): stub
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} 
not registered
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} 
not registered
err:ole:CoGetClassObject no class object {0003000a-0000-0000-c000-
000000000046} could be created for context 0x3


I googled this and saw some other people having the same problem, but I did 
not find any useful answer to this. Then I tried to run the schools example in the 
R2WinBUGS package as follows:


schools <- read.table ("schools.txt", header=TRUE)
 J <- nrow(schools)
  y <- schools$estimate
   sigma.y <- schools$sd
   data <- list ("J", "y", "sigma.y")
   inits <- function() {list (theta=rnorm(J,0,100), mu.theta=rnorm(1,0,100), 
sigma.theta=runif(1,0,100))}
   parameters <- c("theta", "mu.theta", "sigma.theta")
   
   schools.sim <- bugs (data, inits, parameters, model.file="schoolsmodel.bug", 
n.chains=3, n.iter=1000, 
   		bugs.directory="/Applications/WinBUGS14",
		WINE="/Applications/Darwine/Wine.bundle/Contents/bin/wine", 
		
WINEPATH="/Applications/Darwine/Wine.bundle/Contents/bin/winepath",
		useWINE=TRUE,clearWD=FALSE)
		

It still did not work, and the same error message occurred, plus some error 
message from R:

fixme:keyboard:RegisterHotKey (0x10058,13,0x00000002,3): stub
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} 
not registered
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} 
not registered
err:ole:CoGetClassObject no class object {0003000a-0000-0000-c000-
000000000046} could be created for context 0x3
Error in bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE,  : 
  Look at the log file and
try again with 'debug=TRUE' to figure out what went wrong within Bugs.


The information returned from sessionInfo() is the following:

> sessionInfo()
R version 2.8.1 (2008-12-22) 
i386-apple-darwin8.11.1 

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] foreign_0.8-29     arm_1.2-8          R2WinBUGS_2.1-13   coda_0.13-4        
lme4_0.999375-28   Matrix_0.999375-23 lattice_0.17-17   
[8] MASS_7.2-45       

loaded via a namespace (and not attached):
[1] grid_2.8.1



Would someone please help on this ? What did I miss?

Thanks,

Wayne



More information about the R-help mailing list