ClinKit: Streamlined Clinical Data Analysis in R
Hualin Wang
2025-10-15
Source:vignettes/ClinKit-intro.Rmd
ClinKit-intro.RmdIntroduction
ClinKit is an integrated R package designed to transform cleaned clinical datasets directly into publication-ready figures and statistical outputs, while preserving access to raw analysis objects for complete methodological transparency and customization. It is tailored for clinical research workflows, providing a one-stop solution for routine statistical analysis and reporting.
Installation
You can install the development version of ClinKit from GitHub:
# install.packages("devtools")
devtools::install_github("LeafLight/ClinKit")Baseline Table Generation
Generate a baseline characteristics table with automatic test selection:
result <- make_baseline_table(data, group_var = "group")
print(result$summary)
# Export to Word
gtsummary::as_flextable(result$summary) |> flextable::save_as_docx(path = "baseline_table.docx")Regression Analysis
Univariate Logistic Regression
uni_res <- run_univariate_logistic_regression(data, outcome = "outcome", predictors = c("age", "gender"))
print(uni_res$summary)Multivariable Logistic Regression
multi_res <- run_multivariable_logistic_regression(data, outcome = "outcome", predictors = c("age", "gender"), covariates = c("group"))
print(multi_res$summary)Visualization
Scatter Plot with Linear Regression
scatter_lm(data, x = "age", y = "outcome")Specialized Analyses
Exporting Results
- Tables can be exported to Word (
.docx) or CSV. - Figures can be saved as PNG, PDF, or SVG.
Advanced Usage
- All functions return raw analysis objects for further customization.
- Supports integration with tidyverse workflows.
- Publication-ready outputs with minimal code.
Conclusion
ClinKit streamlines the process of clinical data analysis and reporting in R, making it accessible, reproducible, and publication-ready. For more details, visit the ClinKit documentation website.