next up previous contents
Next: Birats: a bivariate Normal Up: BUGS 0.5 Examples Volume Previous: Cervix: case-control study with

Jaw: repeated measures analysis of variance

elston:grizzle:62 present repeated measurements of ramus (jaw) bone height on a cohort of 20 boys over an 18 month period:

table488

Interest focuses on describing the average growth curve of the ramus bone. The 4 measurements tex2html_wrap_inline3324 = { tex2html_wrap_inline3326 } for each child i are assumed to be correlated and follow a multivariate normal (MVN) distribution with unknown population mean vector tex2html_wrap_inline3330 and precision matrix tex2html_wrap_inline3332 . That is tex2html_wrap_inline3334

The following location models for the population mean tex2html_wrap_inline3330 were fitted in turn:

eqnarray515

where tex2html_wrap_inline3220 = age at jth measurement. Non-informative independent normal priors were specified for the regression coefficients tex2html_wrap_inline3342 , tex2html_wrap_inline3344 and tex2html_wrap_inline3346 . The population precision matrix tex2html_wrap_inline3332 was assumed to follow a Wishart tex2html_wrap_inline3350 distribution. To represent vague prior knowledge, we chose the the degrees of freedom tex2html_wrap_inline3352 for this distribution to be as small as possible (i.e. 4, the rank of tex2html_wrap_inline3332 ). The scale matrix R was specified as tex2html_wrap_inline3358 , which represents an assessment of the order of magnitude of the covariance matrix tex2html_wrap_inline3360 for tex2html_wrap_inline3324 (see subsection on the use of the Wishart distribution in the ``Multivariate normal nodes'' section of the BUGS manual 0.50). Note that except for cases with very few individuals, the choice of R has little effect on the posterior estimate of tex2html_wrap_inline3360 [Lindley1970].

Comparision of the fit of the 3 location models may be assessed by calculating the deviance. This is given by -twice the sum of the log-likelihood contributions for each boy i:

eqnarray536

where M=4, the number of measurements per boy. The change in (minimum) deviance between the constant and linear models or the linear and quadratic models may be compared to a tex2html_wrap_inline3374 distribution on 1 degree of freedom. In addition, we may compute the residual sum of squares RSS tex2html_wrap_inline3376 for each model.

The graph of the quadratic model is shown in Figure 7, and the BUGS code is given below.

  
model jaw;
const
 M = 4,   # number of time points 
 N = 20,  # number of boys 
 PI = 3.141593;
var
 Y[N,M], age[M],               # jaw bone length in mm and age
 mu[M],Omega[M,M],Sigma2[M,M], # mean, precision & covariance matrix for Y
 beta0, beta1, beta2,          # regression coefficients for location models
 R[M,M],                       # prior guess at magnitude of Sigma2  
 resid[N,M],resid2[N,M],RSS,   # residuals and residual sum of squares
 L1[N,M],llike[N],deviance;    # log-likelihood terms and deviance 
data Y in "jawy.dat", age, R in "jawcov.dat";
inits in "jaw.in";
{
  for (i in 1:N) {
     Y[i,] ~ dmnorm(mu[], Omega[,]);  # The 4 measurements for each  
  }                                   # boy are multivariate normal

  for(j in 1:M) {     # location model for mean bone length at each age
#    mu[j] <- beta0;                                         # constant
     mu[j] <- beta0 + beta1*age[j];                          # linear
#    mu[j] <- beta0 + beta1*age[j] + beta2*pow(age[j],2);    # quadratic
  }
  beta0 ~ dnorm(0.0, 0.001); 
  beta1 ~ dnorm(0.0, 0.001); 
  beta2 ~ dnorm(0.0, 0.001); 
  Omega[,] ~ dwish(R[,], 4);	# between-child variance in length at each age	
  Sigma2[,] <- inverse(Omega[,]);

  for (i in 1:N) {
     for  (j in 1:M) {
        resid[i,j] <- Y[i,j] - mu[j];         # residuals
        resid2[i,j] <-pow(resid[i,j], 2);     # squared residuals
        L1[i,j] <- inprod(Omega[j,], resid[i,]);
     } 
     llike[i] <- -0.5*(M*log(2*PI) - logdet(Omega[,]) 
                               + inprod(resid[i,], L1[i,])); 
  }
  RSS <- sum(resid2[,]);                     # Residual Sum of Squares
  deviance <- -2 * sum(llike[]);             # Deviance
}

Note that at present, BUGS is unable to perform matrix multiplication. Hence to compute
tex2html_wrap_inline3378 we use the inprod function to first compute tex2html_wrap_inline3380 , and then to compute tex2html_wrap_inline3382 . Also note the use of the inverse function to compute Sigma2.

  figure576
Figure 7:   Graphical model for jaw example.

Analysis

After a 500 iteration burn-in, 1000 iterations took between 12 and 45 seconds for the 3 models and produced the following output {

tabular586

tex2html_wrap_inline3560 MLE = Maximum likelihood estimates obtainied by goldstein:79 (p. 95), and prosser:rasbash:goldstein (p. 106) using the ML3 software.

Examination of the RSS clearly indicates that the linear model is a superior fit to the constant model, but that a quadratic term is unecessary. This is confirmed by the change in (minimum) deviance between successive models: the linear versus constant model yields a log likelihood ratio statistic of 32.4 on 1 d.f. (p<0.000001). The quadratic versus linear model yield virtually identical deviances, giving a non-significant log likelihood ratio statistic.


next up previous contents
Next: Birats: a bivariate Normal Up: BUGS 0.5 Examples Volume Previous: Cervix: case-control study with

Daniel Farewell
Mon Sep 13 16:39:37 BST 1999