APPLICATION OF MARKOV CHAIN MONTE CARLO METHODS TO MODELLING BIRTH PREVALENCE OF DOWN SYNDROME APPLIED STATISTICS ISABELLE BRAY E-mail: I.Bray@plymouth.ac.uk DAVID WRIGHT E-mail: D.Wright@plymouth.ac.uk SCHOOL OF MATHEMATICS UNIVERSITY OF PLYMOUTH PLYMOUTH PL4 8AA PHONE (01752) 232720 FAX (01752) 232780 INTRODUCTION The ASCII file COUNTS.TXT contains the following four columns of raw data separated by commas. Centre ID (As in Table 1) Maternal age (Completed years) Total livebirth count Down syndrome count The ASCII file DOWNS.TXT contains copies of S-Plus objects comprising the data set and functions that we used for performing the MCMC iterations. These objects can be entered directly into S-Plus using the source function source('PATH') where PATH gives the location and name of the file containing the contents of DOWNS.TXT. For example, if you are using a PC and DOWNS.TXT is in the root directory of the C drive, enter the following S-Plus command. source('c:\\downs.txt') WARNING: If your S-Plus directory has any objects with the same names as those contained in DOWNS.TXT, they will be overwritten. Please check the object names and change them if necessary. FUNCTIONS INCLUDED: mcmcI Main function for the MCMC simulations. lr Computation of likelihood ratio used in the above. rmult Samples from a multinomial distribution. rbinom1 Samples from binomial distribution. DATA SETS: Data sets comprising vectors of counts covering ages 16-50 years inclusive. l.1 Vector of total livebirth counts from Hook and Chambers (1977). c.1 Vector of Down syndrome livebirth counts from Hook and Chambers (1977). l.2 Vector of total livebirth counts from Hook and Lindsjo (1978). c.2 Vector of Down syndrome livebirth counts from Hook and Lindsjo (1978). l.3 Vector of total livebirth counts from Huether et al. (1981). c.3 Vector of Down syndrome livebirth counts from Huether et al. (1981). l.4 Vector of total livebirth counts from Staples et al. (1991). c.4 Vector of Down syndrome livebirth counts from Staples et al. (1991). l.5 Vector of total livebirth counts from Lindsten et al. (1981). c.5 Vector of Down syndrome livebirth counts from Lindsten et al. (1981). l.6 Vector of total livebirth counts from Trimble and Baird (1978). c.6 Vector of Down syndrome livebirth counts from Trimble and Baird (1978). l.7 Vector of total livebirth counts from Halliday et al. (1995). c.7 Vector of Down syndrome livebirth counts from Halliday et al. (1995). l.8 Vector of total livebirth counts from Intensive Newborn Studies (1975, 1974). c.8 Vector of Down syndrome livebirth counts from Intensive Newborn Studies (1975, 1974). l.9 Vector of total livebirth counts from Koulischer et al. (1980, 1991). c.9 Vector of Down syndrome livebirth counts from Koulischer et al. (1980, 1991). FUNCTION: mcmcI DESCRIPTION Performs MCMC iterations under prior specifications I, II or III. USAGE mcmcI(niter,temp,start,s1=0.05,s2=0.05,s3=0.005,fixed=T,prior.a=1, prior.b=1) REQUIRED ARGUMENTS niter number of iterations temp object containing MCMC output or starting values: temp$a vector of the alpha parameter temp$b0 vector of the beta0 parameter (on the original age scale) temp$b1 vector of the beta1 parameter temp$p1 etc. vector of the ascertainment probabilities temp$t1 vector of theta 1 temp$t3 vector of theta 3 y.1, y.3 vectors of Downs included in cytogenetic sample and not registered Note that the digit given with the study specific parameters identifies the study in the order given for the livebirth and Down syndrome counts listed above. (Warning: this is different form the order used in the paper.) start element of vectors temp$a - temp$t3 used as starting point for current simulations. OPTIONAL ARGUMENTS s1 standard deviation used in the proposal distribution for log(alpha) s2 standard deviation used in the proposal distribution for beta0 (on the centred age scale) s3 standard deviation used in the proposal distribution for beta1 fixed if T, causes ascertainment probabilities in selected studies to be fixed at unity prior.a, prior.b prior parameters for ascertainment probabilities in selected studies. Applies only when fixed = F. VALUE a list with the same structure as temp containing the results of the MCMC iterations. The vectors y.1 and y.3 relate to the last MCMC iteration. EXAMPLES The file DOWNS.TXT contains the object temp in which temp$a - temp$t3 above are of length=1. The following commands will carry out 500 iterations under priors I, II and III respectively using temp to start the iterations. mcmcI.res<-mcmcI(500,temp,1,fixed=F,prior.a=1,prior.b=1) mcmcII.res<-mcmcI(500,temp,1,fixed=F,prior.a=22,prior.b=1) mcmcIII.res<-mcmcI(500,temp,1,fixed=T,prior.a=22,prior.b=1) The following command will run a further 500 iterations from prior I starting from the last iteration in mcmcI.res. mcmcIa.res<-mcmcI(500,mcmcI.res,500,fixed=F,prior.a=1,prior.b=1) FUNCTION: lr USAGE lr(alpha1, beta.01, beta.11, alpha, beta.0, beta.1, x, n) ARGUMENTS alpha1,beta01,beta11 parameter values for numerator of likelihood ratio alpha,beta0,beta1 parameter values for denominator of likelihood ratio x vector of maternal age specific Down syndrome counts n vector of maternal age specific livebirth counts VALUE Likelihood ratio for modified logistic model. FUNCTION: rmult USAGE rmult(n,p) ARGUMENTS n index parameter p vector of prababilities VALUE sample form a multinomial distribution with index n and probability vector p FUNCTION: rbinom1 USAGE rbinom1(n, size, prob) REQUIRED ARGUMENTS n sample size size binomial index parameters prob binomial probability parameters VALUE vector of binomial counts. This uses the S-Plus function rbinom but avoids warning messages in cases where the index is zero.