Dear list members,
I'm a newcomer in Bayesian modelling and try to model
the following seemingly simple example:
Step 1) From N values of covariate X I generate (e.g. in Excel)
the outcome Z, based on a logistic model:
X[] Z[]
6.3 0
7.3 1
6.0 0
4.7 0
3.4 0
7.6 1
... and so on.
Using BUGS, I then estimate the parameters a and b:
model;
{
a ~ dnorm( 0.0,1.0E-6)
b ~ dnorm( 0.0,1.0E-6)
for( j in 1 : N ) {
logit(g[j]) <- a + b * X[j]
Z[j] ~ dbin(g[j],1) ( or Z[j] ~ dbern(g[j]) )
}
}
The estimated parameters(+-s.e.) agree to the theoretical
parameter values used for data generation.
Step 2) I repeat the data generation K times, which results
in Z1[], Z2[], Z3[],...,ZK[] and aggregate all the
binary outcomes: P[j]=Z1[j]+Z2[j]+...+ZK[j] for all j.
I assume the variate P[] to be binomially distributed,
because it is a sum of binomial variates.
Thus, my BUGS code for analysing P[] is very similar to the
first one:
model;
{
a ~ dnorm( 0.0,1.0E-6)
b ~ dnorm( 0.0,1.0E-6)
for( j in 1 : N ) {
logit(g[j]) <- a + b * X[j]
P[j] ~ dbin(g[j],K)
}
}
However, in this step the estimated parameters(+-s.e.)
DO NOT agree to the theoretical parameter values
used for data generation, but they are biased to zero.
Why that?
I wonder whether anybody can help and find the 'bug'
in my train of thought.
Many thanks in advance and best wishes
Uwe
-------------------------------------------------------------------
To mail the BUGS list, mail to [log in to unmask]
You can search old messages at www.jiscmail.ac.uk/lists/bugs.html
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
This list is for discussion of modelling issues and the BUGS
software. For help with crashes and error messages, first mail
[log in to unmask]
|