Data and Code Replication Package for: Machine Learning-Based Core Body Temperature Prediction from Subcutaneous Implants in Dairy Calves
Description
This repository contains the complete replication package (data assets and executable Quarto scripts) required to reproduce the clinical assessment frequency analyses, multivariable Firth penalized logistic regression models, survival analyses, and propensity score weighting diagnostics presented in the accompanying manuscript submitted to Computers and Electronics in Agriculture journal. The dataset tracks longitudinal clinical health metrics across two commercial livestock facilities (Farm A and Farm B), encompassing a total cohort of 720 unique calves, 9,829 individual calf-day observations collected during a 14-day post-implantation monitoring window, and 740 gastrointestinal bolus administration events. Clinical parameters follow the 4-point scale of the Modified Wisconsin Calf Health Scoring Chart. NOTE: Telemetry databases and machine learning model profiles related to the final validation phases are proprietary commercial property of Wisecow OÜ and are excluded from this repository.
Files
Steps to reproduce
1. Software Prerequisites: Ensure you have R (v4.6.0 or later) and RStudio IDE installed. Your system must have a working LaTeX distribution (e.g., TinyTeX, MikTeX) configured to compile the TikZ structural diagrams within R. 2. Directory Configuration: Download all repository contents and place the four source CSV files (calves_health.csv, analysis_df.csv, GIList.csv, health_data.csv) and the script file (COMPAG fig and tab.qmd) into a unified root working directory. 3. Package Restorations: Open RStudio and ensure the package dependencies listed in the reproducibility_manifest.txt are installed. Core packages required include tidyverse, flextable, gtsummary, logistf, survival, survminer, weightit, cobalt, tikzDevice, and officer. 4. Compilation: Open 'COMPAG fig and tab.qmd' within RStudio and execute the 'Render' command via Quarto. This will programmatically evaluate all data frames, export 'Table2.docx', 'Table3.docx', 'Table4.docx', and generate high-resolution PDF/PNG image assets for Figures 3, 4, 5, and S1.
Institutions
- Estonian University of Life SciencesTartu, Tartu
Categories
Funders
- NGO Estonian Dairy ClusterGrant ID: 616118790023