|
Bayesian Version of Consensus Means Using the BUGS Program (Blaza Toman) |
|||||||||||||||||||||||||||||||||||||||||||
| Introduction | The problem of determining a consensus mean based on data from multiple labs or methods has been fully addressed at NIST from the classical point of view. The result is encoded in the DATAPLOT command CONSENSUS MEAN. A Bayesian solution to this problem can be obtained through the application of hierarchical Bayes models via the Markov Chain Monte Carlo (MCMC) simulation software called BUGS. This report gives the BUGS code for two common hierarchical models and applies it to an example from SRM 1946, Lake Superior Fish Tissue. | ||||||||||||||||||||||||||||||||||||||||||
| Model 1 | |||||||||||||||||||||||||||||||||||||||||||
| Multiple labs: Normal distributions with different means and variances |
This model assumes that the multiple labs data comes from
Normal distributions which have different means and different
variances, that is that Yij is distributed
as
and the variances
are related. That is,
|
||||||||||||||||||||||||||||||||||||||||||
| Borrowing and Vague Priors |
This model allows for borrowing in the estimation of both
the means
,
and the variances
.
This means that even when some of the labs have extremely
small sample sizes (even n=1), the lab variances can be
estimated through the pooling of the hierarchical model.
The prior distributions above are "vague", which is
appropriate when real prior information in the form of expert
opinion or prior data is not available. Analysis performed
using vague prior distributions can be considered objective
and is generally preferred by classical statisticians. When
real prior information is available in the form of a mean and
variance of
,
it can be included by simply changing the mean and variance
of the Normal distribution. If more robustness is required,
a t-distribution with small degrees of freedom can be
substituted for the Normal.
|
||||||||||||||||||||||||||||||||||||||||||
| BUGS code for a two-stage Normal hierarchical model with vague priors and borrowing for both means and variances |
The following is the BUGS code which will carry out the MCMC
simulation to estimate the consensus mean.
model model1;
const
N=13, k=7;
var
theta[k], sigma[k],mu,tau, Y[N], lab[N], a, b, vw[k], vb;
data lab, Y in "fat.dat";
inits in "fat.in";
{
mu ~ dnorm(0, 1.0E-4);
tau ~ dgamma(1.0E-4, 1.0E-4);
a ~ dexp(1.0);
b ~ dgamma(1.0E-4, 1.0E-4);
vb <- 1/tau;
for(i in 1:k) {
sigma[i] ~dgamma(a,b);
theta[i] ~ dnorm(mu, tau);
vw[i] <- 1.0/(sigma[i]); }
for (i in 1:N) {
Y[i] ~ dnorm( theta[lab[i]],sigma[lab[i]]);
}
}
|
||||||||||||||||||||||||||||||||||||||||||
| Model 2 | |||||||||||||||||||||||||||||||||||||||||||
In some cases, the assumption that the variances are related
may not be appropriate. In that case the following model
should be used.
|
|||||||||||||||||||||||||||||||||||||||||||
| BUGS code for a two-stage Normal hierarchical model with vague priors and borrowing for means only |
The following is the BUGS code for this model:
model model2;
const
N= 13, k=7;
var
theta[k], sigma[k],mu,tau, Y[N], lab[N], vw[k], vb;
data lab, Y in "fat.dat";
inits in "fatonest.in";
{
mu ~ dnorm(0, 1.0E-4);
tau ~ dgamma(1.0E-4, 1.0E-4);
for(i in 1:k) {
sigma[i] ~dgamma(1.0E-4, 1.0E-4);
theta[i] ~ dnorm(mu, tau);
vw[i] <- 1.0/(sigma[i]); }
for (i in 1:N) {
Y[i] ~ dnorm( theta[lab[i]],sigma[lab[i]]);
}
}
|
||||||||||||||||||||||||||||||||||||||||||
| Example | |||||||||||||||||||||||||||||||||||||||||||
| Data |
Data from an experiment which weighed the amount of solids
in a sample of dried fish tissue is given in the following
table.
|
||||||||||||||||||||||||||||||||||||||||||
| Results |
Both models were applied with the results given in the
following table.
|
||||||||||||||||||||||||||||||||||||||||||
| Interpretation of the Results |
It is clear from the table that the estimates of the
consensus means are very close and that there is a slight
increase in the size of the posterior HPD due to the reduced
pooling of Model 2.
It is interesting to note that lab 5 had only one observation. This causes most classical consensus mean methods to fail because they require at least two data points to estimate each labs variance. The Bayesian models can handle this situation, even in the case of model 2 where there is no pooling for variance estimation. This is due to the fact that a proper prior (probability distribution) is used and so the variance estimate is based on the prior together with any data that is available. For a comparison, the DATAPLOT Consensus Mean procedure was run on this data and produced the following two estimates:
|
||||||||||||||||||||||||||||||||||||||||||
|
Date created: 9/20/2001 |
|||||||||||||||||||||||||||||||||||||||||||
| [ SED Home | Bayesian Home | Previous | Next ] |