fkbma: an R package for detecting tailoring variables with free-knot B-splines and Bayesian model averaging
Lara Maleyeff, Shirin Golchi, Erica E. M. Moodie · Journal of Statistical Computation and Simulation · 2025
Precision medicine aims to optimize treatment by identifying patient subgroups most likely to benefit from specific interventions. To support this goal, we introduce fkbma, an R package that implements a Bayesian model averaging approach with free-knot B-splines for identifying tailoring variables and treatment-sensitive subgroups. The package employs a reversible jump Markov chain Monte Carlo algorithm to flexibly model treatment effect heterogeneity while accounting for uncertainty in both variable selection and non-linear relationships. It provides a comprehensive framework for detecting predictive biomarkers and enabling robust subgroup identification in clinical trials and observational studies. This paper details the statistical methodology underlying fkbma, outlines its computational implementation, and demonstrates its application through simulated data examples. The flexibility of the package makes it a valuable tool for precision medicine research, offering a principled approach to treatment personalization.