This is the GitHub repository accompanying the manuscript Predicting Resting Metabolic Rate in healthy adults: A Comparative Analysis Using the enable cohort.
All analyses are done in publication.Rmd using R version 4.2.1.
To ensure maximum reproducibility of the models and figures from the publication, the project environment renv is used.
All packages should be installed after running renv::restore().
The data folder is deposited on zenodo and has to be downloaded before running the analysis.
In short, the analysis consists of the following steps:
- Load and clean data Imports Enable and Kiel datasets; standardizes names, fixes formatting issues, merges all sources.
- Define predictor sets Creates groups of clinical, microbial (family level), diversity, and established-model variables; defines response (RMR).
- Prepare data for modeling Removes missing responses, splits into training/test by site.
- Specify and fit models Builds multiple tidymodels workflows (including established equations), tunes them, and stores fitted objects.
- Bootstrap model performance Estimates R² and other metrics via resampling for all models.
- Compare and summarize models Aggregates metrics, prepares comparison tables, generates visual summaries of model performance.
- Predict on test sets Computes predictions for Freising and Nürnberg, evaluates accuracy.
- Plot results Produces summary figures for performance, model comparison, and selected model diagnostics.