[R] Help on using WinBUGS on Mac

Uwe Ligges
2010-01-19T10:24:29Z

On 19.01.2010 03:23, Wayne (Yanwei) Zhang wrote:
> 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



So this is a "WinBUGS on Darwine" question that needs to be solved at
first - pelase ask on a bugs/Darwine/Mac  related mailing list. This is
unrelated to R (and errors with R2WinBUGS on the ancient R version
reported below are coming from this first problem).

Best,
Uwe Ligges



>
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.