[R] BUGS
Uwe Ligges
ligges at statistik.tu-dortmund.de
Wed Aug 19 19:30:47 CEST 2009
stephen sefick wrote:
> Naively it seems that there is no school.txt file in your specified directory.
>
> Stephen Sefick
>
> On Wed, Aug 19, 2009 at 12:05 PM, James
> Lenihan<jameslenihan at sbcglobal.net> wrote:
>> I am running a BUGS function with following
>>
>> schools.sim <-bugs(data,inits,
>> parameters,
>> model.file="schools.txt",
>> n.chains=3,
>> n.iter=1000,
>> bugs.directory="E:/Rprograms")
>>
>> My model.file IS in the directory ="E:/Rprograms" and the code is:
According to ?bugs:
bugs.directory: directory that contains the WinBUGS executable. If the
global option R2WinBUGS.bugs.directory is not NULL, it will be used as
the default.
working.directory: sets working directory during execution of this
function; WinBUGS' in- and output will be stored in this directory; if
NULL, a temporary working directory via tempdir is used.
So either specify working.directory in a way that it points to the
model.txt file or specify a full path name for your model.file
I don't believe that bugs.directory="E:/Rprograms" will do anything
sensible (as it should point to your WinBUGS installation.
Uwe Ligges
>> model{
>> for (j in 1:J){
>> y[j] ~ dnorm (theta[j], tau.y[j])
>> theta[j] ~ dnorm (mu.theta, tau.theta)
>> tau.y[j] <- pow(sigma.y[j], -2)
>> }
>> mu.theta ~ dnorm (0.0, 1.0E-6)
>> tau.theta <- pow(sigma.theta, -2)
>> sigma.theta ~ dunif (0, 1000)
>>
>> I am getting the following error which I can't understand.
>>
>> Error in bugs(data, inits, parameters, model.file = "schools.txt", n.chains = 3, :
>> schools.txt does not exist.
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> 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.
>>
>>
>
>
>
More information about the R-help
mailing list