[R] A question about bugs.R: functions for running WinBUGs from R

From: Li, Jia <LI_at_nsabp.pitt.edu>
Date: Tue 17 May 2005 - 05:20:15 EST


Dear R users,  

I've found bugs.R : the functions for running WinBUGs from R that is writen by Dr. Andrew Gelman who is a professor from Columbia University. The bugs.R would be very useful for me, and I think many of you know it as well. I followed the instuctions on Dr. Gelman's web to install all of documents that bugs.R needs, but when I try to run the school example the web posted in R, I got an error.  

Would you please help me out? I am stuck on this for a while and really frustrated now.  

The program and the error as follow.  

Thanks a lot in advance!  

Jiaa



_
> # R code for entering the data and fitting the Bugs model for 8
schools
> # analysis from Section 5.5 of "Bayesian Data Analysis".
>
> # To run, the Bugs model must be in the file "schools.txt" in your
working
> # directory and you must load in the functions in the bugs.R file (see
> # http://www.stat.columbia.edu/~gelman/bugsR/).
>
> J <- 8
> y <- c(28,8,-3,7,-1,1,18,12)
> sigma.y <- c(15,10,16,11,9,11,10,18)
> schools.data <- list ("J", "y", "sigma.y")
> schools.inits <- function()

+ list (theta=rnorm(J,0,1), mu.theta=rnorm(1,0,100), + sigma.theta=runif(1,0,100))
> schools.parameters <- c("theta", "mu.theta", "sigma.theta")
>
> #run in winbugs14
>
> schools.sim <- bugs (schools.data, schools.inits, schools.parameters,
"schools.bug", n.chains=3, n.iter=1000, version=1.4) Error: couldn't find function "bugs"


        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 17 05:29:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST