Documente Academic
Documente Profesional
Documente Cultură
T-1
1. Outline
• Contents:
• Section 3: Applications in R or S+
T-2
2. First Bayes
T-3
2.1. Notes on using First Bayes:
• Use the Analysis menu to select an appropriate likelihood for the data.
• Enter a prior, followed by Next and then fill out the parameter values for the prior.
T-4
2.2. Analyzing pilot stroke data (strokepilot)
1. In the pilot study on stroke, 10 of 30 patients who were on active treatment suffered
from a severe bleeding accident.
3. Summarize the posterior information by the posterior mean, median, mode and SD.
Also, find the 95% HPD interval.
4. What is the posterior probability that the incidence of SBAs is lower than 0.5?
5. Plot the posterior distribution, together with the prior and the likelihood.
6. What is the probability to see more than 50% of the patients under active treatment
with a SBA in the first interim analysis?
T-5
2.3. Analyzing 1st interim stroke data (strokeinterim1)
• At the first interim analysis of the main study 5 out of 20 stroke patients on active
treatment suffered from a severe bleeding accident.
1. Use the pilot stroke data as a prior to derive the posterior distribution.
3. Assume that the pilot data actually come from 2 pilot studies, each with 15 patients.
One study showed 8 patients on active treatment showing a SBA, the second study
showed 2 patients on active treatment with a SBA. Further, it is believed that both
prior informations are equally valid for the 1st interim analysis. Specify the prior in
First Bayes and derive the posterior distribution given the 1st interim analysis results.
T-6
2.4. A clinical trial on a new mouthwash to reduce plaque (plaque)
• Consider a trial that tests whether daily use of a new mouthwash before tooth brush-
ing reduces plaque when compared to using tap water only. The majority of the pre-
vious trials (say 95%) on similar products showed an overall reduction in plaque be-
tween 5 to 15%. A small study is completed and the results are summarized in
plaque.
1. Use the above information to specify a prior for the percent reductions. Check that
the prior distribution satisfies the desired property.
T-7
2.5. IBBENS study (cholesterol)
T-8
2.6. PANCREAS study (pancreas)
T-9
3. R or S+
T - 10
3.1. Risk of leukaemia following Hodgkin’s disease (example Chapter 3)
• Write a program (or apply the program) in R (or S+) to obtain posterior information
on the log odds ratio.
• Sample also from the posterior distribution to obtain the posterior information of the
odds ratio.
T - 11
3.2. Use of prior information in the analysis of a clinical trial: predictive power
and Bayesian stopping rules
• DerSimonian (SIM, 1996, 15, 1237-1248) considers using prior information from a
meta-analysis on the use of calcium supplementation for the prevention of pre-
eclampsia in pregnant women for the planning of a new trial (CEP).
T - 12
• Meta-analysis: two previous trials (MEDLINE) with similar conditions as the clinical
trial yield median odds-ratio of 0.51 with 99% C.I. of [0.13, 2.01] corresponding to
mean log odds-ratio (θ) of -0.68 (µ0) and variance of 0.54² ( σ 02 ).
T - 13
3.2.2 Bayesian inference
• Prior distribution: (
p0 ( θ ) = φ θ µ0 , σ02 )
• Likelihood: () ( )
p θˆ = φ θˆ θ, σ2 ( σ2 = 0.023)
estimate of θ)
T - 14
3.2.3 Bayesian prediction assuming enthusiastic and skeptical priors
0.6
PRIOR DISTRIBUTION
0.4
-3 -2 -1 0 1 2
LOG ODDS RATIO
T - 15
Predictive power:
• The result will be significantly in favor of a beneficial calcium effect if the 95% inter-
val ⎡⎣ θˆ − 1.96σ, θˆ + 1.96σ ⎤⎦ is on the negative side and excludes 0.
• The probability that θˆ + 1.96σ < 0 is calculated under the prior predictive distribution
to yield the predictive power at the start of the trial. Thus the predictive power is ac-
tually the expected power at the start of the trial using the prior distribution express-
ing the uncertainty of the true log odds-ratio. Thus in our calculations σ2f ≡ σ2 .
⎛ −1.96σ − µ ⎞
• The predictive power is in our case Φ ⎜ 0
⎟.
⎜ σ0 + σ ⎟⎠
2 2
⎝
• Problem: the variance of θ̂ depends on the obtained results and is not constant.
However, we will ignore this problem here.
T - 16
Under the enthusiastic prior:
• P0 = p0 ( θ < 0 ) = 0.90
• For the CEP trial σ2f = 0.023 . Using the prior predictive distribution the predictive
power of a “firm” positive result is p ( θf < 0 ) = 0.75 .
• P0 = p0 ( θ < 0 ) = 0.50
T - 17
3.2.4 Bayesian stopping rules assuming enthusiastic and skeptical priors
• Stopping rule: lower and upper boundaries for stopping the (CEP) trial specified
prior to running the trial
• For each prior we can then determine the under- and upper limit such that (1) and
(2) applies, respectively.
• For the under limit we obtain: θˆ und = ⎣⎡ −σ2µ0 − 1.96σ ( σ2 + σ02 ) ⎤⎦ σ02 and for the upper
T - 18
• We show below the Bayesian boundaries under the enthusiastic and the skeptical
prior and additionally the O’Brien-Fleming (group-sequential) boundaries.
1.5
1.0
ESTIMATE OF LOG ODDS RATIO
BS
0.5
0.0
BE
-0.5
-1.0
OBF
-1.5
T - 19
3.2.5 Exercises
• Explain why the skeptical prior N(0,0.54²) is equivalent to having already conducted
a trial in which about 8% of the total planned sample size for CEP had been entered
and no treatment was observed.
• Spiegelhalter, Freedman and Parmar (JRSSA, 1994, 157, 357-416) advise to use a
community of priors in monitoring and reporting a clinical trial. These should include,
for monitoring, a reference (non-informative), skeptical and enthusiastic prior. Spec-
ify a skeptical prior with mean 0 such that the prior probability that P(θ < -0.45) =
0.05, an enthusiastic prior with the same variance such that P(θ > -0.45) = 0.05. Re-
peat the above analyses with the three priors.
T - 20
3.3. Bleeding accidents in a stroke trial: sampling exercise
• Write a program in R (or S+) to obtain samples from the posterior distribution
B(11,21) after the pilot stroke data have been observed. Sample also the odds.
• Sample first from the prior distribution of the pilot stroke data (uniform prior) and use
the rejection/acceptance method to sample from the posterior.
• Suppose the prior distribution of the stroke trial data should be Beta(5,5). Sample
from the posterior distribution by using the sample of the previous posterior distribu-
tion.
T - 21
3.4. Cross-over trial for 2 antihypertensive drugs
• Replay the analysis in Chapter 5 using the program “bivariate figure posterior cross-
over.SSC”.
T - 22
3.5. Bayesian hierarchical modeling (Chapter 6)
1. Replay the Bayesian hierarchical model of the tumor data using the program “tu-
mor.SSC”.
3. Perform a similar meta-analysis (by changing the previous S+ program) on the fol-
lowing study results collected by Sillero-Arenas et al. (Obstretics & Gynecology,
79,2, 286-294, 1992) on the relationship of hormone replacement therapy and breast
cancer. For a table of the results, see next page. For this analysis import the SAS
data set ‘sillero.SD2”.
T - 23
4. Perform a sensitivity analysis by slightly varying the prior distribution of τ in the
above meta-analysis. This could be done by taking inverse gamma distributions.
T - 24
3.6. Gibbs sampling the beta-binomial distribution (Chapter 7)
• using the Gibbs approach of Chapter 7. Show also the trace plot of the sampled
values. Compare the sample to the true beta-binomial distribution.
T - 25
3. WINBUGS
T - 26
4.1. Notes on using WINBUGS
• Clicking on Help on the WINBUGS menu bar you will find Examples Vol I and Ex-
amples Vol II. These are files with worked out examples in Compound Documents
on a variety of problems. Whenever you have a new problem it is advisable to search
in these 2 documents for an example treating a similar problem and modify it to your
needs.
T - 27
4.2. The osteoporosis regression example
• If necessary look at Section 7. Tutorial, start at 7.3 to run this model in WINBUGS.
• Before you run the program, switch off the blocking mode for fixed effects. In a sec-
ond run switch on the blocking mode again and observe the difference.
• Change the normal distribution of the response into a t-distribution with 4 degrees of
freedom and reanalyze the model. Try out also the logistic distribution. This is an ex-
ample a Bayesian sensitivity analysis.
• Open file “osteo with doodle.odc”. Run the regression model now from the Doodle.
T - 28
• The file “osteomul.odc” allows giving an informative prior for one of the regression
coefficients. Try it out.
• The data file “osteop.txt” contains more regressors than in the previous WB-
programs. Construct a linear regression model in WB with all these regressors to
predict BMCTB.
T - 29
4.3. Beta-blocker meta-analysis
• Carry out a WB run for this model and record the posterior estimate and 95% C.I. in-
terval for the mean log odds-ratio. Further, can you see that there is homogeneity in
the study results?
• Create 2 extra chains for the initial values and check convergence with the Brooks-
Gelman-Rubin diagnostics.
• Examine the posterior estimates of the baseline risks and study odds ratios graphi-
cally.
T - 30
• Rank the studies according to their baseline risk.
• Suppose a new study with twice 100 patients are planned to set up. What is the pre-
dictive distribution of the number of deaths in each arm?
• Replace the normal distribution of the baseline risks and of the log odds ratios by a t-
distribution with 4 degrees of freedom. Compare the models with the Deviance In-
formation Criterion.
• Write a WB model for the absolute risk reduction (ar) assuming that the variance is
known equal to sample variance and make posterior inferences on the number
needed to treat (NNT = 1/ar).
T - 31
4.4. Survival analyses from WB manual
• Observe that one states in the manual that for a censored observation the survival
distribution is a truncated Weibull. This statement is misleading since the authors ac-
tually mean that for a censored observation its contribution to the likelihood is S(ti).
T - 32
4.4.2 Kidney: Weibull regression with random effects (WB Manual I)
• The difference between this model and previous model is that there are two survival
times for each individual. An assumption that is often taken is that conditional on the
individual‘s (unmeasured) characteristics the two observation times are independent.
The unobserved characteristics are represented by a random effect bi (behind the ex-
ponent). In survival analysis exp(bi) is called the frailty parameter.
• Examine:
• The change in the parameter estimates, the 95% C.I.’s and the model evalua-
tion when the survival times are assumed to be independent.
• How the parameter estimates change if the normal distribution for the frailty
component is changed to, say, a t-distribution.
• The sensitivity of the outcome when the prior distribution for τ is changed to a
uniform.
T - 33
4.4.3 Leuk: Cox regression (WB Manual I)
• Observe that in the WB program the use of “eps” is not necessary when defining Y[I,j].
T - 34
• Examine:
• The change in the regression estimates when the different time points for the
baseline hazard are taken.
• The change in the regression estimates when the prior distribution on the
baseline hazard varies.
T - 35
4.4.4 LeukFr: Cox regression with random effects (WB Manual I)
• Examine:
• The change in the regression estimates when Clayton’s approach is taken (by
assuming that the frailty has a Gamma distribution).
T - 36
4.5. Performance of ecmo-machines
• The normal usage is 6-8 hrs at maximum, but here we are looking at patients who
need to be on the machine for several days, even weeks.
T - 37
• The ecmo-machine can terminate for the following reasons:
• the time on the artificial lung was sufficient for the healing process – censoring (by good
health status) (leak/fail = 0);
• the patient got worse and died – censoring (by poor health status) (leak/fail = 0)
• More than one ecmo-machine might be needed for one patient: the standard routine
is to employ one machine but replace by another when it starts leaking (defect).
• There are 6 different types of machines, but we have classified them into two types:
medos or others.
• The above implies that for each patient there are recurrent events, each time the
ecmo machine fails there is an event.
T - 38
• The question which of two classes of ecmo machines performs better: ecmo or the
other types?
T - 39
4.5.2. WINBUGS program for lognormal frailty
• Two chains were run. Estimation was done after 10,000 iterations in each chain
(graphically monitored G-R diagnostics) on 10,000 iterations in each chain.
• The program stopped with an error-message but restarting it resulted in the following
estimates.
T - 40
• The DIC equals 154.94, pD = 116.5 taking into account that the random effects are
estimated too.
T - 41
4.5.3. WINBUGS output for lognormal frailty
T - 42
node mean sd MC error 2.5% median 97.5% start sample
b[1] -0.04833 3.108 0.02197 -6.434 -0.02426 6.212 10001 19998
b[2] -0.4596 2.792 0.02222 -6.661 -0.2624 4.547 10001 19998
T - 43
4.5.4. WINBUGS program & output for gamma frailty
• The program “oxygen survival gamma.odc” replaces the previous lognormal distri-
bution with a gamma(1/γ,1/γ) distribution according to Clayton (Biometrics, 1991).
Clayton suggested to take a non-informative gamma(µ,η) prior with µ=0,η=0. We re-
placed this by uniform prior on [0,100], because the WB-program protested when
generating initial values for the frailties.
• Now the posterior mean for beta.medos (+ 95% C.I.) becomes -3.51, [-6.27, -1.41].
The posterior median for γ is 5.8 with 95% C.I. equal to [0.93, 21.24].
• The deviance information criterion is now 140.4, quite lower than that of the previous
analysis. Now pD = -6.0 indicating non-logconcavity of the likelihood.
T - 44
• Write yourself the program “oxygen survival gamma.odc” starting from “oxygen
survival lognormal.odc”.
T - 45
4.6. Hormone-replacement meta-analysis
• Run the WB-program “sillero meta-analysis with doodle.odc” from the Doodle.
• Give 5 initial overdispersed chains. This can be done by fist looking at a run with one
chain and taking extreme values (judged from the posterior density plots). Apply BOA
on the five chains to assess convergence.
• For installation of BOA, look at the BOA manual. For S+-users an S+-program has
been written assuming five chains (in this case for the osteoporosis example, but this
can be easily modified) which produces all BOA output to check convergence.
T - 46
4.7. Re-analyses of the prostate cancer data
• In the prostate cancer example, 54 subjects were followed over a period varying from
a couple of years to more than 25 years. Looking at the evolutions of the cancer pa-
tients below and reflecting on the nature of cancer, one could wonder whether the
evolution of log(PSA+1) for these patients can be modeled with a broken line linear
regression model.
WINBUGS program
T - 47
Controls BPH cases
4
3
3
ln(1+PSA)
ln(1+PSA)
2
2
1
1
0
0
0 5 10 15 20 25 30 0 5 10 15 20 25 30
4
3
3
ln(1+PSA)
ln(1+PSA)
2
2
1
1
0
0
0 5 10 15 20 25 30 0 5 10 15 20 25 30
T - 48
WINBUGS output
• We have taken 3 chains with a burn-in sample of 10,000 iterations in total. An extra
of 20,000 iterations deliver the estimates.
• Most of the parameters show good convergence with the Brooks-Gelman-Rubin con-
vergence diagnostic. However, some of the change points are very hard to deter-
mine.
T - 49
node mean sd MC error 2.5% median 97.5% start sample
T - 50
node mean sd MC error 2.5% median 97.5% start sample
T - 51
• The parameter beta2 pertains to the part after the change point k (thus most likely
when the cancer has initiated). For the interpretation of the regression coefficient one
must realize that the time-scale has been reversed: we talk here about the years be-
fore diagnosis. Therefore, a negative regression coefficient implies that there is an
increase of the log(PSA+1) towards the end.
• For the first 36 cases the change point has a uniform posterior distribution over the
number of observed time-points). For the 18 cancer cases (shown in the table) the
change-point has a more peaked posterior distribution, but sometimes bi-modal. See
also the densities below.
T - 52
• Some posterior densities of the change point:
T - 53
4.7.2 A random effects model with correlated normal random effects
• Random effects are most often assumed to be correlated. In the next WB program
this assumption is built-in.
WINBUGS program
T - 54
WINBUGS output
• We have taken 3 chains with a burn-in sample of 10,000 iterations in total. An extra
of 20,000 iterations deliver the estimates.
• There are some differences compared to the previous analysis. For instance, the re-
gression coefficient for benign hyperplasia cases decreases but this is compensated
by almost comparable increase of the mean for the random intercept.
• Also some of the posterior distributions of the change points undergo a change.
T - 55
Node mean sd MC error 2.5% median 97.5% start sample
alpha.b 0.3233 0.1262 0.005821 0.07905 0.3228 0.577 10001 30000
alpha.c 0.4217 0.1555 0.00754 0.1308 0.4145 0.7462 10001 30000
beta.age 0.01781 0.007564 2.742E-4 0.003072 0.01782 0.03258 10001 30000
beta2 -0.6182 0.1088 0.004296 -0.8332 -0.6158 -0.4105 10001 30000
mub[1] 0.9914 0.1288 0.004636 0.7357 0.9912 1.244 10001 30000
mub[2] -0.3193 0.07282 0.00157 -0.4623 -0.3195 -0.1769 10001 30000
k[37] 8.258 4.882 0.03948 1.0 8.0 15.0 10001 30000
k[38] 4.464 1.828 0.05366 1.0 4.0 8.0 10001 30000
k[39] 7.655 4.679 0.04148 1.0 7.0 14.0 10001 30000
T - 56
k[49] 6.259 2.636 0.03211 2.0 6.0 13.0 10001 30000
k[50] 2.688 1.553 0.04466 1.0 2.0 6.0 10001 30000
k[51] 5.821 1.811 0.05432 2.0 6.0 8.0 10001 30000
k[52] 4.467 1.766 0.04731 1.0 5.0 7.0 10001 30000
k[53] 4.896 1.627 0.0379 2.0 5.0 7.0 10001 30000
k[54] 2.098 1.359 0.0411 1.0 2.0 6.0 10001 30000
sigma2b[1,1] 0.3956 0.09892 0.002175 0.2387 0.3832 0.6249 10001 30000
sigma2b[1,2] -0.2362 0.05989 9.47E-4 -0.3735 -0.2291 -0.1398 10001 30000
sigma2b[2,1] -0.2362 0.05989 9.47E-4 -0.3735 -0.2291 -0.1398 10001 30000
sigma2b[2,2] 0.1858 0.04356 3.898E-4 0.1169 0.1803 0.2854 10001 30000
sigmab[1] 0.6242 0.07689 0.00172 0.4886 0.6191 0.7905 10001 30000
sigmab[2] 0.4282 0.04938 4.463E-4 0.3419 0.4246 0.5342 10001 30000
corrb -0.8701 0.04772 0.001092 -0.9416 -0.8775 -0.7566 10001 30000
sigma2.r 0.05059 0.003854 2.938E-5 0.04361 0.0504 0.05873 10001 30000
T - 57
k[43] chains 1:3 sample: 30000
0.2
0.15
0.1
0.05
0.0
0 2 4 6 8
T - 58
4.7.3 A random effects model with correlated normal random effects having a t-
distribution
• A simple change in the WB-program turns the normal assumptions of the measure-
ment error and of the random effects into the assumption of a t-distribution.
• Most of the posterior estimates stay the same, but there are changes e.g. the poste-
rior mean becomes -0.43 with 95% C.I. equal to [-0.63, -0.27].
• Write this WB-program and put it in “prostate change point correlated t.odc”.
T - 59
4.8. Relating baseline risk to treatment benefit in a meta-analysis
• Arends et al. (SIM, 2000, 19, 3497-3518) examined some frequentist methods to
analyze the relationship between the baseline risk for morbidity (or mortality) with the
effect of an active treatment in the context of a meta-analysis. More specifically, they
looked at three published studies which related the estimated treatment effects
against the estimated measures of risk in the control groups when performing a
meta-analysis.
T - 60
4.8.2 Meta- analysis 1
y n x m y n x m
0.0 14 6.0 16 5.0 49 16.0 50
6.0 14 11.0 15 4.0 37 9.0 39
0.0 12 8.0 13 1.0 15 5.0 17
2.0 16 3.0 15 6.0 33 15.0 30
6.0 19 11.0 19 15.0 54 25.0 52
2.0 15 2.0 18 11.0 131 6.0 45
0.0 15 10.0 15 0.0 14 0.0 5
• Each row corresponds to a study. The 1st column (y) = number of pre-term births in the treatment group out
of n (2nd column) treated women, the 3rd column (x) = number of pre-term births in the control group out of m
(4th column) control women.
T - 61
• Treatment effect was measured by the log odds ratio log ( y ( m − x ) x ( n − y ) ) . When
there is heterogeneity of the treatment effect among the different studies one needs
to examine the determinants of this lack of homogeneity. An important question is
whether the treatment effect depends on the baseline risk in the population under in-
vestigation in the respective study. The latter could be estimated by the proportion of
pre-term births in the control group, on the original scale or on say the logit-scale.
The following scattergram depicts the log odds ratio and the logit of the baseline risk.
There seems to be a clear negative trend, as seen from the weighted least-squares
regression analysis.
T - 62
0
Weighted LS Regression
-1
Bayesian Analysis
LOG ODSS RATIO
-2
-3
-4
-2 -1 0 1
LOGIT OF BASELINE RISK
T - 63
• To establish the negative trend one often applies a weighted least squares analysis,
like the one shown in the figure. There are several problems with this approach:
• The baseline risk is measured with error and this will bias the slope downward to
zero.
• The regressor and the response are functionally related to each other, so that,
even when there is no relationship between treatment effect and baseline risk a
relationship could appear.
T - 64
4.8.3 The model
1. Underlying regression model: Model for the regression of the true treatment effect
ηi on the true baseline measure ξi:
ηi = α + βξi + εi where εi ∼ N ( 0, τ2 ) .
The residual variance τ2 describes the heterogeneity in true treatment effects (or true
risks under treatment) in populations with the same true baseline risk.
2. Baseline risks model: Model for the distribution of the true baseline risk measures
ξi:
ξi ∼ G ,
with G a parametric model.
T - 65
3. Measurements errors model: Model for the “measurement errors”:
( ξˆ , ηˆ ) given ( ξ , η ) ∼ F ,
i i i i
T - 66
• For the present problem the hierarchical model is given by:
• For the ith trial, Xi and Yi are the numbers of pre-term deliveries out of mi placebo
women and ni women treated with the active treatment, respectively.
• The ξi stand for the true placebo logits and the ηi stand for the true log odds ratios.
• The distribution of the logit of the baseline risks is often taken to be the normal, but
other distributions are certainly possible, e.g. a mixture of normal distributions was
considered by Arends et al. (2000).
T - 67
• The exact measurement model is taken to be the Binomial, more specifically we as-
sume that:
⎛ exp ( ξi ) ⎞
Xi ∼ Bin ⎜ mi , ⎟
⎝ 1 + exp ( ξ )
i ⎠
.
⎛ exp ( ηi + ξi ) ⎞
Yi ∼ Bin ⎜ ni , ⎟
⎝ 1 + exp ( ηi + ξ )
i ⎠
T - 68
WINBUGS program
• Observe that in the WB program the response logit(ηi) in stead of the log odds ratio.
• We have taken 1 chain with a burn-in sample of 10,000 iterations. An extra 10,000 it-
erations deliver the estimates.
T - 69
WINBUGS output
• Observe that posterior mean of eqpoint is very different from posterior median since
beta is sometimes sampled close to zero. Also the MC error is very large.
T - 70
• The figure in 4.8.2 shows that the regression line obtained from a Weighted Least
Squares analysis is biased away from 0 (as expected since a negative correlation is
created). The Bayesian estimated (mean) slope is shrunk towards zero (not signifi-
cant anymore, in a Bayesian sense). The shrinkage is large due to some small trials
with relatively large within-study variance compared to the between-study variance.
• The two standard deviations, sigma.eta and sigma.kse, express the within-study and
between-study variations. The standard deviation of the observed baseline risk (log
odds ratio) is 1.22, while the standard deviation of the true baseline risk is 0.84.
T - 71
4.8.4 Meta-analysis 1: sensitivity analysis
• The last study was not considered by Arends et al., do you think there is a reason
for?
T - 72
4.8.5 Meta-analysis 2
• Arends et al. (SIM, 2000, 19, 3497-3518) looked also at a meta-analysis where the
total number of person-years per group is given in stead of the number of events and
the sample size.
• In this case the research question was whether drug treatment prevents death in mild
to moderate hypertensive patients and whether the size of the treatment effect de-
pends on the event rate in the control group.
T - 73
Study Treatment group Control group
T - 74
• Now, the ξi stand for the true control log-mortality rates while the ηi stand for the true
treatment log-mortality rates.
Xi ∼ Poisson ( mi exp ( ξi ) )
.
Yi ∼ Poisson ( ni exp ( ηi ) )
• Observe that the above model assumes that the events occur over the individuals in
an independent way, which is often crudely assumed in epidemiology (see e.g. Clay-
ton, Statistical models in epidemiology, 1993, pp. 40-43).
T - 75
WINBUGS program
• We have taken 1 chain with a burn-in sample of 10,000 iterations for each of the
chains. An extra 10,000 iterations deliver the estimates.
T - 76
WINBUGS output
• Now the within-study variability (sigma.eta) is much smaller than the between-study
variability (sigma.ksi).
T - 77
4.8.6 Meta-analysis 2: sensitivity analysis
• Perform a sensitivity analysis varying the different aspects of the model. Evaluate the
models with the Deviance Information Criterion.
T - 78
4.9. Estimating disease prevalence (in the absence of a gold standard)
• The goal is to estimate the prevalence of a disease using one diagnostic test.
• Suppose (in theory) one would have the table (D = disease, T = test)
D+ D- Total
T+ a b a+b
T- c d c+d
Total a+c b+d- N
T - 79
Three cases
• Case 1: diagnostic test is a gold standard, this implies that sensitivity (S) = 1 &
specificity (C) = 1.
• Case 2: diagnostic test is not a gold standard, but a gold standard is available.
• Case 3: diagnostic test is not a gold standard & (no gold) standard test is available.
T - 80
Case 1: diagnostic test is a gold standard (S = 1 & C = 1)
T - 81
Case 2: diagnostic test is not a gold standard, but a gold standard is available
( )
πˆ = P ( T + ) + C − 1 ( S + C − 1) , (1)
whereby P ( T + ) = ( a + b ) N .
• Observe that sensitivity and specificity must be the same in the controlled experiment
as in the epidemiological study.
T - 82
Case 3: diagnostic test is not a gold standard & (no gold) standard test is available
Total
Test+ a+b ≡ m
Test- c+d ≡ n
Total N
• A Bayesian approach is necessary to get estimates for the prevalence (and sensitivity
& specificity).
T - 83
4.9.1.2. Bayesian approach
• Assume that the following table underlies the data, with Y1 the missing number of
true positives and Y2 the missing number of false negatives:
D+ D- Total
T+ Y1 m-Y1 m
T- Y2 n-Y2 n
Total Y1+Y2 N-( Y1+Y2) N
• The Y1 and Y2 are called latent data and an analysis using such data is called a “la-
tent class analysis”.
T - 84
• To write down the likelihood (of the observed and latent data) we express the prob-
abilities in terms of the prevalence (π), sensitivity (S) and specificity (C):
T - 85
4.9.1.3. Example
• Observed data:
marginal totals
T+ m = 40
T- n = 122
Total 162
T - 86
4.9.1.4. Bayesian analysis
Prior information
• Panel experts from McGill Centre for Tropical Diseases determined equally tailed
95% probability intervals for sensitivity and specificity (from a review of the literature
and clinical opinion), see below (with associated Beta parameters):
95% range α β
S 5-45 4.44 13.31
C 90-100 71.25 3.75
• Beta densities can be obtained by matching the endpoints of the 95%-ranges to the
theoretical ranges from the Beta density.
T - 87
WINBUGS program
• Joseph et al. (1995) have written an S+ program based on the full conditional distribu-
tions of the parameters, i.e. Y1, Y2, π, S and C.
• In the file “prevalence 1 test b.odc” the latent (missing) data are also determined.
• The WB program has also a goodness-of-fit statistic G0, and a Bayesian P-value
which compares the fit of the observed data to the data generated under the assumed
model.
• Three chains were run, a burn-in sample in each chain of 1000 iterations were taken
and the estimation was done on 2000 iterations in each chain.
T - 88
WINBUGS output
T - 89
4.9.2 Two or more diagnostic tests
• Usually more than diagnostic test is available. The purpose is then to get an improved
estimate of the prevalence using all tests.
• For example in the Cambodian refugees example, the following table was available:
• The first test is the examination of the stool; the second test is a serology test. Neither
of the tests can be considered as a gold standard.
T - 90
4.9.2.2. Bayesian approach
• As for one diagnostic test, one can assume that there are latent data completing the
2x2-table to the 2x2x2-table. Assuming conditional independence (conditional on
the disease) of the tests, namely
( ) ( ) (
P T1+ & T2+ D+ = P T1+ D+ P T2+ D+ , )
one derives again the likelihood of the (observed and latent) data.
• For the prevalence, again a uniform prior was chosen. Further, for the sensitivity and
specificity the experts derived a similar table as for the first test.
95% range α β
S 65-95 21.96 5.49
C 35-100 4.1 1.76
T - 91
• Joseph et al. (1995) have written an S+ program based on the full conditional distribu-
tions of the parameters. In the file “prevalence 2 tests_1.odc” an equivalent WB pro-
gram is given.
• Three chains were run, a burn-in sample in each chain of 1000 iterations were taken
and the estimation was done on 2000 iterations in each chain. The following table is
obtained (next page).
• It is clearly seen that the second test increases the information regarding the preva-
lence considerably, but it also sharpens the posterior information regarding the sensi-
tivity and specificity of the first diagnostic test.
T - 92
• WB results from both diagnostic tests combined:
T - 93
4.9.2.3. An alternative Bayesian approach
• The sensitivity and specificity as determined in a controlled experiment cannot be used to esti-
mate the prevalence of the disease since they are not intrinsic values, but depend on e.g. the
geographical area. However, specificity can be estimated in real life by performing an epidemi-
ological study in an area which is known to be disease-free. But, even if sensitivity could be es-
timated from a controlled experiment, say by randomly infecting the subjects (when dealing with
animals), such experiments must be done on a small scale since they are often quite costly.
• Since no hard data are available on sensitivity, prior information on this parameter
must be obtained from eliciting experts, but that is not trivial. For all of these reasons
another approach is taken now. We start with an example in veterinary medicine.
T - 94
4.9.2.4. Example in veterinary medicine
• Porcine cysticercosis is a major problem in many areas, being a debilitating and po-
tentially lethal zoonosis (Garcia & Del Brutto, 2000; Phiri et al., 2002).
• Several diagnostic tests are used, but none is a gold standard and exact information
about test sensitivity and specificity is unavailable.
• A total of 868 traditionally kept pigs from Zambia were tested with 2 diagnostic tests:
palpation of the tong (TONG), visual inspection of the carcass (VISUAL).
T - 95
• The following table of marginal totals is obtained
- - 744
- + 9
+ - 3
+ + 112
T - 96
4.9.2.5. A different parameterization
- - - - - -
- - + - - +
- + - - + -
- + + - + +
( ) ( ) (
• This table implies probabilities P T1+ & T2+ D+ , P T1+ & T2− D+ , …, P T1− & T2− D− . )
There are 8 -1 = 7 parameters to estimate with only 4 cell frequencies. Hence 3 pa-
rameters need to be fixed or, in a Bayesian context, prior distributions could be given.
T - 97
(
• It is advantageous to reformulate these probabilities in: (1) P ( D + ) , (2) P T1+ D+ , )
( ) ( ) ( ) (
(3) P T1− D− , (4) P T2+ D+ & T1+ , (5) P T2+ D+ & T1− , (6) P T2− D− & T1− , (7) )
(
P T2− D− & T1+ )
• The prevalence of D but also the sensitivities and specificities can be formulated in
these probabilities:
p = (1), Se1 = (2), Sp1 = (3), Se2 = (2)⋅(4)-[1-(2)] (5), Sp2 = (3) (6)-[1-(3)] (7)
T - 98
Problem: on which parameters to put a prior distribution?
• Two cases:
T - 99
Remarks
• The constraints Sp1 = 1, Sp2 = 1 imply that certain probabilities drop from the model.
• To verify which of the two “experts’ opinions” are consistent with the data, the Devi-
ance Information Criterion (DIC) can be used.
• The effective number of parameters that are estimated when the parameters are sub-
ject to probabilistic constraints could be obtained from pD.
T - 100
WINBUGS program
• To compare the two models (expert 1 & expert 2) for each WB run we invoke the DIC
option. This allows to choice the best model (prior + likelihood) and to estimate the
number of effective parameters estimated.
• Three chains were run; estimation was done after 10,000 iterations in each chain
(graphically monitored G-R diagnostics) on 4000 iterations in each chain.
T - 101
WINBUGS output
Expert 1
node mean sd MC error 2.5% median 97.5% start sample
prev 0.1455 0.01198 1.111E-4 0.1229 0.1452 0.1698 10001 12000
sens1 0.6926 0.007363 1.14E-4 0.673 0.6949 0.6998 10001 12000
sens2 0.9548 0.02186 2.518E-4 0.9043 0.9583 0.9871 10001 12000
Expert 2
node mean sd MC error 2.5% median 97.5% start sample
prev 0.3417 0.1807 0.007197 0.1692 0.2699 0.8597 10001 12000
sens1 0.4727 0.1787 0.006841 0.1532 0.4913 0.7681 10001 12000
sens2 0.4938 0.1833 0.007082 0.1611 0.5167 0.7838 10001 12000
T - 102
• Results on DIC and pD:
Expert 1
Expert 2
• The Bayesian P-value was 0 for the first model; for the second model P = 0.51.
T - 103
Remarks
• The value of pD is negative for the second model. A possible reason is that the non-
log concavity of the likelihood. However, when looking in the expression for pD one
can see that only the posterior mean of the multinomial probabilities is needed. Actu-
ally, these probabilities are non-linear functions of the parameters. Therefore, one
should evaluate DIC and pD at the posterior mean of the multinomial probabilities and
not at the posterior mean of the parameters of the model. However, this calculation
needs to be done outside of WB, using the deviance obtained from WB. We have
written an S+-program “DIC and pD for 2 diagnostic tests.ssc” to do this.
• We have recalculated the DIC and pD for the two models. For the first model we ob-
tain: DIC = 56.71 and pD = 1.78. For the second model we obtain: DIC = 19.16 and pD
= 2.78.
T - 104
• The results imply the following:
• Models 1 and 2 show a clear difference in the estimates for the prevalence
and sensitivity & specificity.
• The value of DIC is much higher for the first model than for the second model,
which implies that the second model fits the data better. This is also reflected
in the Bayesian P-value.
T - 105
4.9.2.6. More than 2 diagnostic tests
• In the previous example two other tests: Ag-ELISA and Ab-ELISA were also meas-
ured. The model that uses expert 2 prior information and some strong priors on the
specificity of the latter two tests has the lowest DIC (= 70.25) with a reasonable pD =
9.98 (using the S+-program DIC and pD for 4 diagnostic tests.ssc) compared to six
other models among which were the models with a prior belief as expert 1.
T - 106
Advantages of using a Bayesian approach
• There are more parameters than the data allow to be estimated. Therefore con-
straints on the parameters are needed. The constraints can be deterministic (like S =
1), but prior information is rarely always clear cut and therefore probabilistic con-
straints (like encountered) are more realistic.
T - 107
4.9.2.7. Exercises
T - 108
4.10. Modeling extra-Poisson variation
• A longitudinal dental study, performed in Flanders, examined the teeth of about 5000
schoolchildren. At yearly intervals, starting at the age of seven, the dmft-score,
which is the sum of the number of decayed, missing and filled primary teeth, was
determined.
• Here we examine this score on the first year and for a subgroup of 276 children, ran-
domly selected from the total study group.
• The dmft-score is a count and thus a candidate for having a Poisson distribution.
However, when one tooth is decayed there is a high probability that the neighbouring
teeth also become decayed when not treated quickly. This creates a correlation be-
tween the 0s and 1s that are added up to create the count.
T - 109
• The mean dmft-score is equal to 2.56, the variance equals 10.0. Hence there is
clearly is extra-Poisson variation (see also figure below).
0.5
0.4
0.3
0.2
0.1
0.0
0 5 10 15 20
dmft
T - 110
4.10.2. Candidate models
T - 111
4.10.3. WINBUGS programs
• The file “poisson model x on dmft scores.odc” contains the WB program for model
x.
• For all models we calculated the deviance, and when possible also DIC and pD.
• For all models we took 3 parallel chains with a burn-in of at least 2000 iterations for
each chain. 2000 extra iterations were run to estimate the parameters and to calcu-
late DIC and pD. The Brooks-Gelman-Rubin diagnostics were used to assess conver-
gence.
T - 112
4.10.4. Results
• The Poisson models corresponding to values from the 95% C.I. show a bad fit to the
histogram.
T - 113
Model 2: Poisson-Gamma model
T - 114
OBSERVED DMFT-SCORES SAMPLED DMFT-SCORES
POSTERIOR GAMMA DISTRIBUTION
0.6
0.5
0.5
0.6
0.4
0.4
0.3
DENSITY
0.4
0.3
0.2
0.2
0.2
0.1
0.1
0.0
0.0
0.0
0 5 10 15 20 0 5 10 15 20 25
0 5 10 15
dmft dmft
POISSON MEAN
T - 115
Model 3: Zero-inflated Poisson model
• According to the deviance this model is inferior to the Gamma-Poisson mixture model.
T - 116
Model 4: mixture of 4 Poisson distributions
T - 117
• Based on the posterior median values, the four Poisson components are given be-
low:
1.0
0.5
0.8
0.4
0.6
0.3
PROB
PROB
0.4
0.2
0.2
0.1
0.0
0.0
0 5 10 15 20 0 5 10 15 20
DMFT SCORE DMFT SCORE
0.15
0.15
0.10
PROB
PROB
0.10
0.05
0.05
0.0
0.0
0 5 10 15 20 0 5 10 15 20
T - 118
Model 5: mixture of 4 Poisson-Gamma distributions
T - 119
4.10.5. Advantages of using a Bayesian approach
• The advantage of using a Bayesian approach lies here more in the use of a flexible
software package which allows fitting different and sometimes complex models rela-
tively easy.
T - 120
4.10.6. Exercises
T - 121
4.11. Examining a geographical trend in caries experience
• In the Signal Tandmobiel study of 4.10 we examined the geographical spread of car-
ies experience as measured by the dmft-score of the first year’s results.
• Now we evaluate a subgroup of 600 children, randomly selected from the total study
group.
• Besides the epidemiological dental data measured in schools also 3 calibration exer-
cises were done in separate meetings. Sixteen dental examiners were involved in
the total study. In the calibration exercises the examiners assigned dmft-scores to
children involved in the exercise and these scores can be compared to the scores of
the reference examiner (≈ gold standard).
T - 122
• The caries experience in Flanders (1st year’s results) can be geographically repre-
sented by the following map (based on ordinal score of dmft (split up in 3 classes)):
E a st
A n tw e r p
F la n d e r s
W e st
F la n d e r s L im b u rg
K E Y
[0 .4 9 ,1 .1 0 ] ( 1 .1 0 ,1 .4 0 ] ( 1 .4 0 ,2 .2 5 ] B ra b a n t
T - 123
• However, when we geographically present the scoring behavior of the dental exam-
iners according to the schools in which they we see the same trend:
E ast
A n tw e r p
F la n d e r s
W est
F la n d e r s L im b u rg
K E Y
( - 1 5 % ,- 5 % ] ( - 5 % ,5 % ] ( 5 % ,1 8 % ) B ra b a n t
T - 124
Question:
T - 125
4.11.2. Considered ordinal logistic regression models
• Ordinal logistic model with Y as response and x- & y-co-ordinate of the school (and
other child-specific variables) as regressors. The result is a significant trend (in
Bayesian sense) in the x-direction. School is also included as a random effect.
• Previous ordinal logistic model supplemented with indicator variable for each ex-
aminer. The result is a much reduced effect in the x-direction.
• First ordinal logistic model whereby the score of the dental examiner is corrected
for possible examiner bias with the correction factor estimated from the calibration
data.
T - 126
Logistic regression model corrected for examiner bias
• Denote the score from the dental examiner by YE and the (true) score by YG, then
P ( YE = 1 x ) = γ 0 + (1 − γ 0 − γ1 ) P ( YG = 1 x ) , (1)
• If for the gold standard P ( YG = 1 x ) is a (binary) logistic regression model, then for the
exp ( x )
F(x) = .
1 + exp ( x )
T - 127
• The parameters γ0 and γ1 can be estimated from a table like
gold standard
0 1
T - 128
Ordinal case (Y = 1, 2, 3, 4)
( φ ) Fy (βT x ) ,
4
P ( YE = j x ) = ∑ πy E yG G
yG =1
whereby FyG ( βT x ) the ordinal logistic regression model for the gold standard predict-
• Typically validation sets (and calibration exercises) are rather small in nature, yielding
sparse data. That is why the probability π yE yG ( φ ) is also modelled.
T - 129
4.11.3. Bayesian approach to estimate the regression parameters in the geo-
graphical dental study
1. Ordinal logistic regression model for the ordinal caries scores of the 600 children
participating in main part of the study.
2. A model for the (sparse) calibration data. Several models were tried out. The
model used here assumes that the dental examiner’s score is located for all values
of the score in-between the worst scorer and the gold standard and that in the
same way. That is: dental examiner j = wj gold standard + (1-wj) worst scorer.
T - 130
4.11.4. WINBUGS programs
1. Bayesian ordinal random logistic regression model with covariates age and gen-
der of the child, the x- and y-co-ordinates of the child’s school and a normal ran-
dom school effect.
2. Previous model augmented with the correction for examiner bias, whereby the
correction parameters are estimated from the calibration exercises taking into
account the variability with which the correction parameters are determined. Ac-
tually 2 parallel Markov chains are run, one for the epidemiological data and
one for the calibration data.
• Observe that the WB function cut has been used to ensure that the γ-parameters are
only estimated from the calibration data.
T - 131
4.11.5. Results
• DIC and pD were calculated for all models. Bayesian P-values to indicate the signifi-
cance of each regressor in the Bayesian sense were also calculated.
T - 132
Ordinal logistic regression without correction:
Table of estimates
T - 133
node mean sd MC error 2.5% median 97.5% start sample
x-coord 0.2023 0.0849 0.001173 0.03893 0.2 0.3724 5001 10000
pvalue] 0.0082 0.09018 8.914E-4 0.0 0.0 0.0 5001 10000
y-coord 0.00372 0.08503 0.001159 -0.162 0.002493 0.1724 5001 10000
pvalue 0.4884 0.4999 0.006431 0.0 0.0 1.0 5001 10000
gender -0.02628 0.1549 0.004162 -0.3295 -0.02743 0.2766 5001 10000
pvalue 0.5673 0.4955 0.01141 0.0 1.0 1.0 5001 10000
age 0.2522 0.1981 0.002203 -0.1351 0.2503 0.6359 5001 10000
pvalue 0.1033 0.3044 0.003283 0.0 0.0 1.0 5001 10000
sigma² 0.08498 0.08339 0.004742 0.008016 0.05602 0.3146 5001 10000
pvalue 0.0 0.0 4.472E-13 0.0 0.0 0.0 5001 10000
T - 134
• Model diagnostics
T - 135
Ordinal logistic regression with correction:
Table of estimates
T - 136
node mean sd MC error 2.5% median 97.5% start sample
x-coord 0.2199 0.09172 0.001731 0.0455 0.2193 0.3996 10001 20000
pvalue 0.0056 0.07462 8.824E-4 0.0 0.0 0.0 10001 20000
y-coord -0.002996 0.0935 0.001782 -0.1864 -0.004425 0.1772 10001 20000
pvalue 0.5185 0.4997 0.00954 0.0 1.0 1.0 10001 20000
gender -0.02264 0.1897 0.004897 -0.394 -0.02135 0.3538 10001 20000
pvalue 0.5461 0.4979 0.01134 0.0 1.0 1.0 10001 20000
age 0.2939 0.2188 0.003699 -0.1356 0.2958 0.7282 10001 20000
pvalue 0.08665 0.2813 0.004691 0.0 0.0 1.0 10001 20000
sigma2 0.09045 0.1015 0.005273 0.00354 0.05258 0.3679 10001 20000
pvalue 0.0 0.0 3.162E-13 0.0 0.0 0.0 10001 20000
T - 137
• Calibration parameters (first 8 dental examiners)
T - 138
• Model diagnostics
• The significant increase in caries experience in the x-direction remains after correc-
tion for examiner bias. The model expresses now the relationship between caries ex-
perience (as if scored only by the gold standard) and x-coordinate, y-coordinate, gen-
der and age + random effect for school.
T - 139
4.11.6. Advantages of using a Bayesian approach
• The WINBUGS program allows taking into account the variability with which
the correction parameters are estimated in a relatively simple manner, without
analytic calculations.
T - 140
4.11.7. Exercises
T - 141
4.12. A spatial epidemiological analysis on lip cancer in East-Germany
• The risk factors for lip cancer are: smoking, exposure to sunlight and excessive con-
sumption of alcohol.
• Mortality from lip cancer in former East Germany has been under surveillance since
1961. The data for the male population has been described in Möhner, Stabenow and
Eisinger (Atlas der Krebsinzidenz in der DDR 1961-1989). We analyze the data from
the period 1980-1989.
• In total there were 219 sub-regions (see Chapter 7) but here some have been com-
bined to give 195 sub-regions.
T - 142
• It has been hypothesized that the mortality rates tend to cluster geographically and
that the risk of the disease among those engaged in occupations such as farming,
fishing and forestry is twice as high as the risk of those not engaged in such occupa-
tions. The variable AFF represents the percentage of the population in the sub-region
involved in farming, fishing and forestry.
T - 143
4.12.2. Descriptive maps
• When a map has been created before (see Geobugs Manual) observed data as well
as output from a Bayesian analysis can be displayed in a spatial manner. The map
“Germany.map” is needed here, and should be included in the directory of maps.
• We show on the next page the map of East-Germany displaying the standardized
mortality rates according to the 195 sub-regions.
• From the disease map a clear North-West gradient in relative risk is observed.
T - 144
values for smr (49) < 0.79
N
(48) 1.05 - 1.58
100.0km
T - 145
4.12.3. Candidate models for disease mapping
• As seen in Chapter 7, the disease map based on the SMRs provides not a good basis
for spatial inference. The reason for this is that the SMRs are based on the data of
the sub-region only and hence shows too high variability. For this reason one needs
to base the disease map on a statistical model which takes into account that the SMR
of a sub-region is related to the SMRs of other (neighboring) sub-regions.
T - 146
• The following models will be considered:
• Model 3: Besag, York and Mollié model: in this model for relative risks, the
area-specific random effects are decomposed into correlated and uncorrelated
heterogeneity
T - 147
4.12.4. Model 1: Poisson-Gamma model
• The model is the same as given in Chapter 7, i.e. for the jth sub-region we assume
that
O j ∼ Poisson ( θ j E j ) (Poisson part of the model)
with α and β the parameters of the prior distribution of the relative risks.
T - 148
• The WB program is in “East-Germany Lip Mortality males Poisson-Gamma
model.odc”. Three chains were initiated and convergence was checked after 10,000
iterations per chain. The Brooks-Gelman-Rubin diagnostic showed convergence.
The estimates are based on extra 5,000 iterations per chain.
T - 149
• The disease map based on the posterior mean of the relative risks (in quartiles) is
given below.
T - 150
• As seen in Chapter 7, there is shrinkage of the relative risks compared to the SMRs.
T - 151
4.12.5. Model 2: Poisson-lognormal model
with v j ∼ N ( 0,σ2v ) .
• Including covariates into the Poisson-lognormal model is easily done. For instance,
one could assume that the mean of log ( θ j ) varies with the covariate AFF. Namely,
α j = β0 + β1 × AFFj .
T - 152
• The map of AFF can also be produced with WB (see next page). A similar North-
South trend in AFF is observed.
• We analyze here:
• The impact of AFF on the relative risk.
• The North-South gradient after taking into account AFF.
• The WB program slightly deviates from the model specified on the previous page in
the sense that v j ∼ N ( α, σ2v ) or v j ∼ N ( α j , σ2v ) to improve convergence.
T - 153
T - 154
• On the next two pages we show the map of the posterior mean of θj and of the
Bayesian residual subtracting the impact of AFF on θj.
• The second map shows that there is still a North-South gradient (although less pro-
nounced) after having taken into account the impact of AFF.
T - 155
T - 156
T - 157
4.12.6. Model 3: Besag, York and Mollié model
• This model for relative risks decomposes the area-specific random effects into a
component that takes into account the effects that vary in a structured manner in
space (correlated heterogeneity) and a component that models the effects that
vary in an unstructured way between areas (uncorrelated heterogeneity).
• The model introduced by Clayton and Kaldor (1987) and developed by Besag et al.
(1991) is called the CAR model (conditional autoregressive model) and is given by
O j ∼ Poisson ( θ j E j ) ,
log ( θ j ) ∼ α + u j + v j ,
where α is an overall level of the relative risk, uj is the correlated heterogeneity and
vj is the uncorrelated heterogeneity. The u and v parameters are surrogates for un-
known or unobserved covariates.
T - 158
• The assumptions are:
1
uj = ∑ uk ωkj
∑ kj k
ω
k
• Parameters τ2v and τu2 control the variability of v and u. When τ2v is close to zero
there is practically no unstructured variability, a high value means substantial but un-
structured extra-Poisson variability. When τu2 is close to zero there is practically no
spatial variation, a high value means a large structured variation.
T - 159
• As prior distributions for τ2v and τu2 gamma distributions were taken.
• The CAR model is improper (the overall mean of the uj’s is not defined). Therefore
one must impose a constraint to ensure that the model is identifiable; Besag and
Kooperberg (1995) show that constraining the random effects to sum to zero and
specifying a separate intercept term with a location invariant Uniform[-∞,∞] prior is
T - 160
equivalent to the unconstrained parameterization with no intercept. The improper
(flat) prior is obtained from the dflat() function.
T - 161
• From the above output we can conclude that τ2v is much smaller than τu2 indicating lit-
tle unstructured variation and a much clearer spatial dependence of the sub-regions.
• On the next page we show the map of the posterior mean of θj. A similar smoothing
as with the previous models is observed.
T - 162
T - 163
• As for the Poisson-lognormal model we can also evaluate the impact of AFF on
the relative risks. This can be done as in the Poisson-lognormal model, i.e.:
log ( θ j ) ∼ α j + u j + v j , (1)
with α j = β0 + β1 × AFFj
log ( θ j ) ∼ α j , (2)
T - 164
• The WB program for the first approach is in “East-Germany Lip Mortality males
CAR model with AFF.odc”. Two chains were initiated and convergence was
checked after 10,000 iterations per chain. The Brooks-Gelman-Rubin diagnostic
showed convergence. The estimates are based on extra 10,000 iterations per chain.
• Also now AFF seems to be of importance. However, the inclusion of AFF did not re-
move much of the random spatial structure; the unstructured random part remained
about the same.
T - 165
• The value of pD is equal to 104.1 and DIC = 1092.270.
• On the next page we show the fitted map and the map of residuals, i.e. of O j − θˆ jE j .
T - 166
T - 167
• The WB program for the second approach is in “East-Germany Lip Mortality
males AFF CAR model.odc”. Two chains were initiated and convergence was
checked after 10,000 iterations per chain. The Brooks-Gelman-Rubin diagnostic
showed convergence. The estimates are based on extra 10,000 iterations per chain.
• The importance of AFF is now seen in τu2 and in the map illustrating the impact of
AFF in each sub-region (see below).
T - 168
• The value of pD is equal to 83.71 and DIC = 1238.430. Hence DIC is much higher
than in the previous model. However, observe that this model does not contain un-
structured variability.
T - 169
T - 170
• The WB program including unstructured variability is found in “East-Germany
Lip Mortality males AFF CAR + unstr model.odc”. Two chains were initiated and
convergence was checked after 10,000 iterations per chain. The Brooks-Gelman-
Rubin diagnostic showed convergence. The estimates are based on extra 10,000 it-
erations per chain.
• Compared to the previous model the deviance has decreased considerably. The
value of pD is equal to 109.23 and DIC = 1100.0. Hence by including the unstruc-
tured variability also the value of DIC has decreased considerably.
T - 171
T - 172
4.12.7. Exercises
• Write the program “East-Germany Lip Mortality males AFF CAR model.odc”.
T - 173