ClinKit is an advanced R framework tailored for clinical researchers and epidemiologists. It transforms cleaned datasets into publication-ready artifacts (Word tables and high-resolution figures) through a standardized, modular, and highly reproducible workflow.
- ⚡ Interactive Scaffolding: Deploy a complete clinical project structure and master control center with a single command.
- 📈 Hierarchical Sequential Modeling: Automatically generate Model 1 (Unadjusted) through Model N (Fully Adjusted) for Logistic, Cox PH, and Multinomial regressions.
- 🧪 Built-in Methodological Rigor: Automated normality testing for intelligent descriptive statistics and "Anti-Cartesian" alignment for multi-level outcome reporting.
- 📄 Journal-Ready Outputs: Unified I/O routing with auto-formatted
.docxtables (standardized Times New Roman and three-line table layout).
You can install the development version of ClinKit from GitHub:
# install.packages("devtools")
devtools::install_github("LeafLight/ClinKit")ClinKit enforces a "Configuration-Driven" modular workflow to ensure your research is traceable and reproducible.
library(ClinKit)
use_clinkit_project()
This creates a standardized directory structure (data/, scripts/, results/) and the 00_Master_Config.R dashboard.
Open 00_Master_Config.R to define your outcomes, primary predictors, and hierarchical adjustment layers (Model 1-N).
Run the following functions within your config center to generate standalone, task-specific scripts:
use_module_baseline() # Deploys Table 1 (Patient Characteristics)
use_module_multivariable() # Deploys Table 3 (Sequential Adjusted Models)
use_module_rcs() # Deploys Non-linear Trend Analysis (RCS)
use_module_forest() # Deploys Subgroup Interaction Plots
Features built-in Shapiro-Wilk/KS testing. It automatically switches between Mean ± SD and Median (IQR) based on distribution and exports directly to publication-quality Word documents.
run_multivariable_logistic_regression(): Standardized Adjusted Odds Ratios (aOR).run_multivariable_cox_regression(): Sequential Adjusted Hazard Ratios (aHR).run_multivariable_multinomial_logistic_regression(): Handling multi-category outcomes with perfect row alignment across adjustment levels.
generate_rcs_plot(): Restricted Cubic Splines with multi-model support.subgroup_forest(): Subgroup interaction forest plots with professional color themes (Blue, Green, Cyan).run_reclassification_analysis(): Comprehensive calculation of NRI (Net Reclassification Index) and IDI (Integrated Discrimination Improvement).
| Feature | ClinKit Framework | Traditional R Scripting |
|---|---|---|
| Adjustment Layers | Automated (Model 1-N) | Manual formula rewriting |
| Reference Categories | Auto-persisted (1.00 (Ref)) | Manual row insertions |
| I/O Management | Unified routing & timestamps | Scattered ggsave / write.csv |
| Reproducibility | Config-driven modularity | Fragile, monolithic scripts |
For full function references and step-by-step case studies, please visit: ClinKit Documentation Portal
Methodological contributions, bug reports, and pull requests are welcome!
- Author: Hualin Wang
- License: MIT
