Forgive me for bothering the list with what must be a trivial question, but
I am trying to get started with BUGs and have hit a wall. I don't
understand what is incorrect in the syntax of the file below or the meaning
of the error messages that start with "Warning -- expected data read."
I am merely trying to duplicate the surgical example.
Thanks so much for your time.
Bob Gerzoff
U.S. Centers for Disease Control and Prevention
Division of Public Health Systems
[log in to unmask]
The file R.dat looks like:
35
47
85
The file N.dat looks like:
100
100
100
and the file testinit.dat looks like:
0.3
0.3
0.3
Welcome to BUGS on 7 th Oct 1998 at 12:23:23
BUGS : Copyright (c) 1992 .. 1995 MRC Biostatistics Unit.
All rights reserved.
Version 0.603 for 32 Bit PC.
For general release: please see documentation for disclaimer.
The support of the Economic and Social Research Council (UK)
is gratefully acknowledged.
Bugs>compile("test2.bug")
model test.fix;
const
N=3;
var
r[N],
n[N],
p[N],
mu,
tau;
data r in "r.dat", n in "n.dat" ;
inits p in "testinit.dat";
{
for (i in 1:N) {
r[i] ~ dbin(p[i],n[i]);
logit(p[i]) <- b[i];
b[i] ~ dnorm(mu, tau);
}
mu ~ dnorm(0.0,1.0E-6);
tau ~ dgamma(1.0E-3,1.0E-3);
}
Parsing model declarations.
Loading data value file(s).
Warning -- expected data read before end of file
Warning -- expected data read before end of file
Loading initial value file(s).
Warning -- expected data read before end of file
Parsing model specification.
Error in file: test2.bug
logit(p[i]) <- b[i];
$
at line 17 column 20
-- error --
Expected a parameter.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|