Section: Animal Science
Topic: Agricultural sciences, Applied biological sciences

A modelling framework for the prediction of the herd-level probability of infection from longitudinal data

10.24072/pcjournal.80 - Peer Community Journal, Volume 2 (2022), article no. e4.

Get full text PDF Peer reviewed and recommended by PCI
The collective control programmes (CPs) that exist for many infectious diseases of farm animals rely on the application of diagnostic testing at regular time intervals for the identification of infected animals or herds. The diversity of these CPs complicates the trade of animals between regions or countries because the definition of freedom from infection differs from one CP to another. In this paper, we describe a statistical model for the prediction of herd-level probabilities of infection from longitudinal data collected as part of CPs against infectious diseases of cattle. The model was applied to data collected as part of a CP against bovine viral diarrhoea virus (BVDV) infection in Loire-Atlantique, France. The model represents infection as a herd latent status with a monthly dynamics. This latent status determines test results through test sensitivity and test specificity. The probability of becoming status positive between consecutive months is modelled as a function of risk factors (when available) using logistic regression. Modelling is performed in a Bayesian framework, using either Stan or JAGS. Prior distributions need to be provided for the sensitivities and specificities of the different tests used, for the probability of remaining status positive between months as well as for the probability of becoming positive between months. When risk factors are available, prior distributions need to be provided for the coefficients of the logistic regression, replacing the prior for the probability of becoming positive. From these prior distributions and from the longitudinal data, the model returns posterior probability distributions for being status positive for all herds on the current month. Data from the previous months are used for parameter estimation. The impact of using different prior distributions and model implementations on parameter estimation was evaluated. The main advantage of this model is its ability to predict a probability of being status positive in a month from inputs that can vary in terms of nature of test, frequency of testing and risk factor availability/presence. The main challenge in applying the model to the BVDV CP data was in identifying prior distributions, especially for test characteristics, that corresponded to the latent status of interest, i.e. herds with at least one persistently infected (PI) animal. The model is available on Github as an R package ( and can be used to carry out output-based evaluation of disease CPs.
Published online:
DOI: 10.24072/pcjournal.80
Type: Research article
Madouasse, Aurélien 1; Mercat, Mathilde 1; van Roon, Annika 2; Graham, David 3; Guelbenzu, Maria 3; Santman Berends, Inge 2, 4; van Schaik, Gerdien 2, 4; Nielen, Mirjam 2; Frössling, Jenny 5, 6; Ågren, Estelle 5, 6; Humphry, Roger 7; Eze, Jude 7; Gunn, George 7; Henry, Madeleine K. 7; Gethmann, Jörn 8; More, Simon J. 9; Toft, Nils 10; Fourichon, Christine 1

1 BIOEPAR, INRAE, Oniris – Nantes, France
2 Department of Population Health Sciences, Unit Farm Animal Health, Faculty of Veterinary Medicine, Utrecht University – Utrecht, the Netherlands
3 Animal Health Ireland, Unit 4/5 – Carrick-on-Shannon, Ireland
4 Royal GD – Deventer, the Netherlands
5 Department of Animal Environment and Health, Swedish University of Agricultural Sciences – Skara, Sweden
6 Department of Disease Control and Epidemiology, National Veterinary Institute (SVA) – Uppsala, Sweden
7 Epidemiology Research Unit, Scotland’s Rural College – Edinburgh, United Kingdom
8 Institute of Epidemiology, Friedrich-Loeffler-Institut – Federal Research Institute for Animal Health (FLI) – Riems, Germany
9 Centre for Veterinary Epidemiology and Risk Analysis, UCD School of Veterinary Medicine, University College Dublin – Dublin, Ireland
10 IQinAbox ApS – Værløse, Denmark
License: CC-BY 4.0
Copyrights: The authors retain unrestricted copyrights and publishing rights
     author = {Madouasse, Aur\'elien and Mercat, Mathilde and van Roon, Annika and Graham, David and Guelbenzu, Maria and Santman Berends, Inge and van Schaik, Gerdien and Nielen, Mirjam and Fr\"ossling, Jenny and \r{A}gren, Estelle and Humphry, Roger and Eze, Jude and Gunn, George and Henry, Madeleine K. and Gethmann, J\"orn and More, Simon J. and Toft, Nils and Fourichon, Christine},
     title = {A modelling framework for the prediction of the herd-level probability of infection from longitudinal data},
     journal = {Peer Community Journal},
     eid = {e4},
     publisher = {Peer Community In},
     volume = {2},
     year = {2022},
     doi = {10.24072/pcjournal.80},
     url = {}
AU  - Madouasse, Aurélien
AU  - Mercat, Mathilde
AU  - van Roon, Annika
AU  - Graham, David
AU  - Guelbenzu, Maria
AU  - Santman Berends, Inge
AU  - van Schaik, Gerdien
AU  - Nielen, Mirjam
AU  - Frössling, Jenny
AU  - Ågren, Estelle
AU  - Humphry, Roger
AU  - Eze, Jude
AU  - Gunn, George
AU  - Henry, Madeleine K.
AU  - Gethmann, Jörn
AU  - More, Simon J.
AU  - Toft, Nils
AU  - Fourichon, Christine
TI  - A modelling framework for the prediction of the herd-level probability of infection from longitudinal data
JO  - Peer Community Journal
PY  - 2022
VL  - 2
PB  - Peer Community In
UR  -
DO  - 10.24072/pcjournal.80
ID  - 10_24072_pcjournal_80
ER  - 
%0 Journal Article
%A Madouasse, Aurélien
%A Mercat, Mathilde
%A van Roon, Annika
%A Graham, David
%A Guelbenzu, Maria
%A Santman Berends, Inge
%A van Schaik, Gerdien
%A Nielen, Mirjam
%A Frössling, Jenny
%A Ågren, Estelle
%A Humphry, Roger
%A Eze, Jude
%A Gunn, George
%A Henry, Madeleine K.
%A Gethmann, Jörn
%A More, Simon J.
%A Toft, Nils
%A Fourichon, Christine
%T A modelling framework for the prediction of the herd-level probability of infection from longitudinal data
%J Peer Community Journal
%D 2022
%V 2
%I Peer Community In
%R 10.24072/pcjournal.80
%F 10_24072_pcjournal_80
Madouasse, Aurélien; Mercat, Mathilde; van Roon, Annika; Graham, David; Guelbenzu, Maria; Santman Berends, Inge; van Schaik, Gerdien; Nielen, Mirjam; Frössling, Jenny; Ågren, Estelle; Humphry, Roger; Eze, Jude; Gunn, George; Henry, Madeleine K.; Gethmann, Jörn; More, Simon J.; Toft, Nils; Fourichon, Christine. A modelling framework for the prediction of the herd-level probability of infection from longitudinal data. Peer Community Journal, Volume 2 (2022), article  no. e4. doi : 10.24072/pcjournal.80.

PCI peer reviews and recommendation, and links to data, scripts, code and supplementary information: 10.24072/pci.animsci.100007

Conflict of interest of the recommender and peer reviewers:
The recommender in charge of the evaluation of the article and the reviewers declared that they have no conflict of interest (as defined in the code of conduct of PCI) with the authors or with the content of the article.

[1] Baum, L. E.; Eagon, J. A. An inequality with applications to statistical estimation for probabilistic functions of Markov processes and to a model for ecology, Bulletin of the American Mathematical Society, Volume 73 (1967) no. 3, pp. 360-363 | DOI

[2] Beaudeau, F.; Belloc, C.; Seegers, H.; Assie, S.; Pourquier, P.; Joly, A. Informative Value of an Indirect Enzyme-Linked Immunosorbent Assay (ELISA) for the Detection of Bovine Viral Diarrhoea Virus (BVDV) Antibodies in Milk, Journal of Veterinary Medicine Series B, Volume 48 (2001) no. 9, pp. 705-712 | DOI

[3] Booth, R. E.; Cranwell, M. P.; Brownlie, J. Monitoring the bulk milk antibody response to BVDV: the effects of vaccination and herd infection status, Veterinary Record, Volume 172 (2013) no. 17, p. 449-449 | DOI

[4] Bronner, A.; Morignat, E.; Hénaux, V.; Madouasse, A.; Gay, E.; Calavas, D. Devising an Indicator to Detect Mid-Term Abortions in Dairy Cattle: A First Step Towards Syndromic Surveillance of Abortive Diseases, PLOS ONE, Volume 10 (2015) no. 3 | DOI

[5] Cameron, A. The consequences of risk-based surveillance: Developing output-based standards for surveillance to demonstrate freedom from disease, Preventive Veterinary Medicine, Volume 105 (2012) no. 4, pp. 280-286 | DOI

[6] Carpenter, B.; Gelman, A.; Hoffman, M. D.; Lee, D.; Goodrich, B.; Betancourt, M.; Brubaker, M.; Guo, J.; Li, P.; Riddell, A. Stan: A Probabilistic Programming Language, Journal of Statistical Software, Volume 76 (2017) no. 1 | DOI

[7] Collins, J.; Huynh, M. Estimation of diagnostic test accuracy without full verification: a review of latent class methods, Statistics in Medicine, Volume 33 (2014) no. 24, pp. 4141-4169 | DOI

[8] Curriero, F. C.; Shone, S. M.; Glass, G. E. Cross Correlation Maps: A Tool for Visualizing and Modeling Time Lagged Associations, Vector-Borne and Zoonotic Diseases, Volume 5 (2005) no. 3, pp. 267-275 | DOI

[9] Damiano, L.; Peterson, B.; Weylandt, M., StanCon 2018 (Asilomar), Asilomar Conference Center, California, 10-12 January 2018, 2018 | DOI

[10] Denwood, M. J. runjags: AnRPackage Providing Interface Utilities, Model Templates, Parallel Computing Methods and Additional Distributions for MCMC Models inJAGS, Journal of Statistical Software, Volume 71 (2016) no. 9 | DOI

[11] Duncan, A. J.; Gunn, G. J.; Humphry, R. W. Difficulties arising from the variety of testing schemes used for bovine viral diarrhoea virus (BVDV), Veterinary Record, Volume 178 (2016) no. 12, p. 292-292 | DOI

[12] Fernandes, L. G.; Denwood, M. J.; de Sousa Américo Batista Santos, C.; Alves, C. J.; Pituco, E. M.; de Campos Nogueira Romaldini, A. H.; De Stefano, E.; Nielsen, S. S.; de Azevedo, S. S. Bayesian estimation of herd-level prevalence and risk factors associated with BoHV-1 infection in cattle herds in the State of Paraíba, Brazil, Preventive Veterinary Medicine, Volume 169 (2019) | DOI

[13] Gabry, J.; Cešnovar, R. cmdstanr: R Interface to ‘CmdStan’, 2020 (,

[14] Hui, S. L.; Walter, S. D. Estimating the Error Rates of Diagnostic Tests, Biometrics, Volume 36 (1980) no. 1 | DOI

[15] Johnson, W. O.; Gardner, I. A.; Metoyer, C. N.; Branscum, A. J. On the interpretation of test sensitivity in the two-test two-population problem: Assumptions matter, Preventive Veterinary Medicine, Volume 91 (2009) no. 2-4, pp. 116-121 | DOI

[16] Le Strat, Y.; Carrat, F. Monitoring epidemiologic surveillance data using hidden Markov models, Statistics in Medicine, Volume 18 (1999) no. 24, pp. 3463-3478 | DOI

[17] Martin, P.; Cameron, A.; Greiner, M. Demonstrating freedom from disease using multiple complex data sources, Preventive Veterinary Medicine, Volume 79 (2007) no. 2-4, pp. 71-97 | DOI

[18] Norström, M.; Jonsson, M. E.; Åkerstedt, J.; Whist, A. C.; Kristoffersen, A. B.; Sviland, S.; Hopp, P.; Wahlström, H. Estimation of the probability of freedom from Bovine virus diarrhoea virus in Norway using scenario tree modelling, Preventive Veterinary Medicine, Volume 116 (2014) no. 1-2, pp. 37-46 | DOI

[19] Nusinovici, S.; Madouasse, A.; Hoch, T.; Guatteo, R.; Beaudeau, F. Evaluation of two pcr tests for Coxiella burnetii detection in dairy cattle farms using latent class analysis, PLOS ONE, Volume 10 (2015) no. 12 | DOI

[20] O'Hara, R. B.; Sillanpää, M. J. A review of Bayesian variable selection methods: what, how and which, Bayesian Analysis, Volume 4 (2009) no. 1 | DOI

[21] Plummer, M. JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling In: Hornik, K. , Leisch, F. , & Vines, K. (eds), Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003). (2003) (

[22] Qi, L.; Beaunée, G.; Arnoux, S.; Dutta, B. L.; Joly, A.; Vergu, E.; Ezanno, P. Neighbourhood contacts and trade movements drive the regional spread of bovine viral diarrhoea virus (BVDV), Veterinary Research, Volume 50 (2019) no. 1 | DOI

[23] R Core Team R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria., 2020 (

[24] Rabiner, L. A tutorial on hidden Markov models and selected applications in speech recognition, Proceedings of the IEEE, Volume 77 (1989) no. 2, pp. 257-286 | DOI

[25] Raue, R.; Harmeyer, S. S.; Nanjiani, I. A. Antibody responses to inactivated vaccines and natural infection in cattle using bovine viral diarrhoea virus ELISA kits: Assessment of potential to differentiate infected and vaccinated animals, The Veterinary Journal, Volume 187 (2011) no. 3, pp. 330-334 | DOI

[26] Stan Development Team Stan Modeling Language Users Guide and Reference Manual, Version 2.26., 2021 (

[27] Toft, N.; Jørgensen, E.; Højsgaard, S. Diagnosing diagnostic tests: evaluating the assumptions underlying the estimation of sensitivity and specificity in the absence of a gold standard, Preventive Veterinary Medicine, Volume 68 (2005) no. 1, pp. 19-33 | DOI

[28] Touloupou, P.; Finkenstädt, B.; Spencer, S. E. F. Scalable Bayesian Inference for Coupled Hidden Markov and Semi-Markov Models, Journal of Computational and Graphical Statistics, Volume 29 (2019) no. 2, pp. 238-249 | DOI

[29] van Roon, A.; Santman-Berends, I.; Graham, D.; More, S.; Nielen, M.; van Duijn, L.; Mercat, M.; Fourichon, C.; Madouasse, A.; Gethmann, J.; Sauter-Louis, C.; Frössling, J.; Lindberg, A.; Correia-Gomes, C.; Gunn, G.; Henry, M.; van Schaik, G. A description and qualitative comparison of the elements of heterogeneous bovine viral diarrhea control programs that influence confidence of freedom, Journal of Dairy Science, Volume 103 (2020) no. 5, pp. 4654-4671 | DOI

[30] van Roon, A.; Mercat, M.; van Schaik, G.; Nielen, M.; Graham, D.; More, S.; Guelbenzu-Gonzalo, M.; Fourichon, C.; Madouasse, A.; Santman-Berends, I. Quantification of risk factors for bovine viral diarrhea virus in cattle herds: A systematic search and meta-analysis of observational studies, Journal of Dairy Science, Volume 103 (2020) no. 10, pp. 9446-9463 | DOI

[31] Whittington, R.; Donat, K.; Weber, M. F.; Kelton, D.; Nielsen, S. S.; Eisenberg, S.; Arrigoni, N.; Juste, R.; Sáez, J. L.; Dhand, N.; Santi, A.; Michel, A.; Barkema, H.; Kralik, P.; Kostoulas, P.; Citer, L.; Griffin, F.; Barwell, R.; Moreira, M. A. S.; Slana, I.; Koehler, H.; Singh, S. V.; Yoo, H. S.; Chávez-Gris, G.; Goodridge, A.; Ocepek, M.; Garrido, J.; Stevenson, K.; Collins, M.; Alonso, B.; Cirone, K.; Paolicchi, F.; Gavey, L.; Rahman, M. T.; de Marchin, E.; Van Praet, W.; Bauman, C.; Fecteau, G.; McKenna, S.; Salgado, M.; Fernández-Silva, J.; Dziedzinska, R.; Echeverría, G.; Seppänen, J.; Thibault, V.; Fridriksdottir, V.; Derakhshandeh, A.; Haghkhah, M.; Ruocco, L.; Kawaji, S.; Momotani, E.; Heuer, C.; Norton, S.; Cadmus, S.; Agdestein, A.; Kampen, A.; Szteyn, J.; Frössling, J.; Schwan, E.; Caldow, G.; Strain, S.; Carter, M.; Wells, S.; Munyeme, M.; Wolf, R.; Gurung, R.; Verdugo, C.; Fourichon, C.; Yamamoto, T.; Thapaliya, S.; Di Labio, E.; Ekgatat, M.; Gil, A.; Alesandre, A. N.; Piaggio, J.; Suanes, A.; de Waard, J. H. Control of paratuberculosis: who, why and how. A review of 48 countries, BMC Veterinary Research, Volume 15 (2019) no. 1 | DOI

[32] Yackulic, C. B.; Dodrill, M.; Dzul, M.; Sanderlin, J. S.; Reid, J. A. A need for speed in Bayesian population models: a practical guide to marginalizing and recovering discrete latent states, Ecological Applications, Volume 30 (2020) no. 5 | DOI

[33] Zucchini, W.; MacDonald, I. L.; Langrock, R. Hidden Markov Models for Time Series, Chapman and Hall/CRC, Second edition / Walter Zucchini, Iain L. MacDonald, and Roland Langrock. | Boca Raton : Taylor & Francis, 2016. | Series: Monographs on statistics and applied probability ; 150 | “A CRC title.”, 2017 | DOI

Cited by Sources: