# Congdon P., pag. 17, Example 2.1 Systolic blood pressure # # Short description. # Suppose we take a random sample of 20 systolic blood pressure # readings y_i from a subpopulation of adult men. # We know from national surveys that sigma =13. # We are interested in estimating mu, the mean blood pressure in the # particular diagnostic group of our study, and predicting its likely # level in a typical new patient in the same diagnostic group. # Suppose we select a non informative prior regarding mu. # Suppose we know the typical blood pressure for all adult males is # 125, and we wish to test whether the particular diagnostic group # has above or below average pressure # Program 2.1 Systolic Blood Pressure # downloaded from # http://www.mrc-bsu.cam.ac.uk/bugs/weblinks/webresource.shtml # model {# known variance sigma2 <- 169; # precision = 1/variance tau <-1/sigma2; # Prior on normal mean mu ~ dnorm(0,0.00001); # likelihood for (i in 1:N) { y[i] ~ dnorm(mu,tau)} # samples where H0 holds p.above <- step(mu-125); # samples where H1 holds p.below <- step(125-mu); # prediction for 'new' patient y.new ~ dnorm(mu,tau) } Data list(N=20, y=c(98,160,136,128,130,114,123,134,128,107,123,125,129,132,154, 115,126,132,136,130))