Chapter 10 Exercise 4 - Multiple tests

10.1 Questions

Open up the R project for Exercise 4 (i.e., the R project file named Exercise 4.Rproj).

In the Exercise 4 folder, you will find partially completed R scripts. To answer the questions, try to complete the missing parts (they are highlighted by a #TO COMPLETE# comment). We also provided complete R scripts, but try to work it out on your own first!

During the study comparing PAG to US, a third test (a trans-rectal manual exam; TRE) was conducted on most cows. To be honest, this third exam was conducted later (>50 days post-AI). But, for the sake of the exercise, you could consider that three diagnostic tests (PAG, US, and TRE) were all conducted at the same time point and develop a LCM for 3 diagnostic tests applied to one single population (i.e., herd #1).

Table. Cross-classified results from a PAG, US, and TRE diagnostic tests in herd #1.

TRE+ TRE-
US+ US- US+ US-
PAG+ 126 3 PAG+ 12 7
PAG- 0 0 PAG- 1 112

1. How many degrees of freedom and unknown parameters do you have? How many informative priors will be needed?

2. Start from the partially completed Question 2.R script located in Exercise 4 folder. Run a model using informative priors for US’ Se and Sp and pregnancy prevalence and with vague priors on all other parameters. Then run a second model with vague priors on all parameters. We will assume conditional independence between tests and we will also assume that this is one single population. Do you expect any problem with the model using vague priors on all parameters?

10.2 Answers

1. How many degrees of freedom and unknown parameters do you have? How many informative priors will be needed?

Answer: We have 7 degrees of freedom and 7 unknown parameters, so we do not need any informative priors.

2. Run a model using informative priors for US and pregnancy prevalence and with vague priors on all other parameters. Then run a second model with vague priors on all parameters. We will assume conditional independence between tests and we will also assume that this is one single population. Do you expect any problem with the model using vague priors on all parameters?

Answer: The first model with informative priors on US’ Se, Sp and on pregnancy prevalence ran well. The Markov chains were nice. With 30,000 iterations, I do get a decent ESS (around 5,000 for the worst parameter, Se_PAG). The median estimates and 95 CI are reported in the table below.

A priori, I would also expect that the LCM with vague priors on all parameters will work well, since it is identifiable. This was the case, the Markov chains were also nice. The lowest ESS was again around 5,000 (with 3 times 10,000 iterations). If it was for publication, we could run these LCM for more iterations to reach an ESS > 10,000 for all parameters. Results for the LCM with vague priors are also reported in the table below.

There were very little differences between the two LCM. Only the US’ Se and Sp estimates were slightly affected. The LCM with informative priors generated posterior estimates that were somewhere in between the prior estimates and the estimates from the LCM with vague priors (i.e., between the priors and the data).

Table. Results from a 3 tests, 1 population LCM using different priors (informative on pregnancy prevalence and on US Se and Sp vs. vague priors on all parameters).

Parameter Informative Vague
Prior Posterior Prior Posterior
Prev Beta(4.2, 5.4) 0.539 (0.479, 0.599) Beta(1.0, 1.0) 0.541 (0.481, 0.602)
Se PAG Beta(1.0, 1.0) 0.995 (0.973, 1.00) Beta(1.0, 1.0) 0.995 (0.972, 1.00)
Sp PAG Beta(1.0, 1.0) 0.942 (0.887, 0.978) Beta(1.0, 1.0) 0.938 (0.885, 0.974)
Se US Beta(100, 12) 0.939 (0.904, 0.964) Beta(1.0, 1.0) 0.972 (0.933, 0.992)
Sp US Beta(100, 6.2) 0.969 (0.940, 0.986) Beta(1.0, 1.0) 0.986 (0.953, 0.999)
Se TRE Beta(1.0, 1.0) 0.907 (0.850, 0.949) Beta(1.0, 1.0) 0.909 (0.852, 0.950)
Sp TRE Beta(1.0, 1.0) 0.994 (0.969, 1.00) Beta(1.0, 1.0) 0.994 (0.967, 1.00)