Air: Berkson measurement error

Do children who breathe more nitrogen dioxide (NO2) at home report more respiratory illness? Whittemore and Keller (1988) put the question to records on 103 children, and Stephens and Dellaportas (1992) later revisited the same records by Bayesian methods. The children are divided into three groups according to the NO2 concentration measured in the child's bedroom, with n = 48, 34 and 21 children in the three groups and y = 21, 20 and 15 of them reporting illness. The covariate Z records the nominal concentration attached to each group, 10, 30 and 50, the midpoints of the three categories. The question is how the probability of respiratory illness varies with exposure.

The complication is that the bedroom reading is only a surrogate for the exposure that matters, the true average NO2 level X experienced by a child in that group. Here the calibration linking the two is treated as known, so X[j] is drawn from a normal distribution centred on $\alpha + \beta Z_j$ with $\alpha = 4.48$, $\beta = 0.76$ and precision $\tau = 0.01234$, corresponding to a residual variance of about 81. Because the unobserved true covariate is written as a function of the observed one rather than the other way round, this is a Berkson measurement-error model: the error is independent of the recorded Z and correlated with the true exposure.

\[\begin{aligned} y_j &\sim \text{Binomial}(p_j,\ n_j), \qquad j = 1, 2, 3 \\ \text{logit}(p_j) &= \theta_1 + \theta_2 X_j \\ X_j &\sim \text{Normal}(\alpha + \beta Z_j,\ \tau) \end{aligned}\]

As always in BUGS, the second argument of the normal is a precision rather than a variance. Only the logistic-regression coefficients $\theta_1$ and $\theta_2$, given vague independent normal priors with precision 0.001, and the three latent exposures $X_j$ are estimated; $\alpha$, $\beta$ and $\tau$ are supplied as data. With three binomial observations and three latent covariates there is very little information in the data about the slope, so the posterior for $\theta_2$ is correspondingly wide. This is one of the examples in Volume 2 of the classic BUGS examples; see also the OpenBUGS version of this example.

The model definition, data, initial values, and published reference results shown here all come from JuliaBUGS.BUGSExamples.VOLUME_2.air, which ships with the package.

Model

using JuliaBUGS

example = JuliaBUGS.BUGSExamples.VOLUME_2.air
example.model_def
quote
    for j = 1:J
        y[j] ~ dbin(p[j], n[j])
        p[j] = logistic(theta[1] + theta[2] * X[j])
        X[j] ~ dnorm(mu[j], tau)
        mu[j] = alpha + beta * Z[j]
    end
    theta[1] ~ dnorm(0.0, 0.001)
    theta[2] ~ dnorm(0.0, 0.001)
end

The program as it appears in the original BUGS distribution:

print(example.original_syntax_program)
model
{
   for(j in 1 : J) {
      y[j] ~ dbin(p[j], n[j])
      logit(p[j]) <- theta[1] + theta[2] * X[j]
      X[j] ~ dnorm(mu[j], tau)
      mu[j] <- alpha + beta * Z[j]
   }
   theta[1] ~ dnorm(0.0, 0.001)
   theta[2] ~ dnorm(0.0, 0.001)
}

Data

example.data
(J = 3, y = [21, 20, 15], n = [48, 34, 21], Z = [10, 30, 50], tau = 0.01234, alpha = 4.48, beta = 0.76)

Compiling the model

model = JuliaBUGS.compile(example.model_def, example.data, example.inits)
BUGSModel (parameters are in transformed (unconstrained) space, with dimension 5):

  Model parameters:
    X[3], X[2], X[1]
    theta[2], theta[1]

  Variable sizes and types:
    alpha: type = Float64
    p: size = (3,), type = Vector{Float64}
    n: size = (3,), type = Vector{Int64}
    X: size = (3,), type = Vector{Float64}
    Z: size = (3,), type = Vector{Int64}
    mu: size = (3,), type = Vector{Float64}
    tau: type = Float64
    beta: type = Float64
    J: type = Int64
    y: size = (3,), type = Vector{Int64}
    theta: size = (2,), type = Vector{Float64}

The example's own initial values are passed in here. Several of these models fail from random starting values, so example.inits is not optional in practice; a second set is available as example.inits_alternative.

See Getting Started for the recipe that takes a compiled model to posterior samples.

Reference results

The posterior summaries published with the original example. A converged chain should reproduce these up to Monte Carlo error.

example.reference_results
(var"X[1]" = (mean = 13.48, std = 8.403), var"X[2]" = (mean = 27.35, std = 7.462), var"X[3]" = (mean = 40.73, std = 8.798), var"theta[1]" = (mean = -1.061, std = 2.42), var"theta[2]" = (mean = 0.0519, std = 0.09807))